今日のテーマ   日々改造 (^_^;)         
[記事リスト(ツリー表示)]  [ 返信 ]   [新着記事] [最新50] [ワード検索] [過去ログ]

タイトル Re^2: _ST in Pascal_ (1981)
投稿日: 2022/11/18(金) 20:28
投稿者文太
 番 号 10427    10425 番 としき さんへのコメント    コメント数 2

#10417
>訳書で言うところの序論("Introduction")の
>最初の5パラグラフほどを読んでいただくと、その先を読みすすめるべきか判断
>できると思います。

 構造化、という文脈で、この本が出てきたのでしたっけ? たぶん、もう5パラグラフ
読んだと思うけど(最後までできるものなら読み通したいとの判断)、僕との会話で
としきさんが何に引っかかったのか(思い出したか)知りたいので、もう一度読んで
みます。
「序論」後半は、先の各章の簡単な紹介ですよね。
 ただ、元がpdfで上下さかさま(OCRで化け化け化け化け)のページが「序論」
に入っていたみたいなので、ちょっと1ページごとのe-text作りになりそう。

 具象的個々別々の問題への抽象的解法を見出す。

 僕が日常的にやっている作業より高度なテキスト処理の話だと思うけど、プログラミング
環境を整えるプログラムの作成について、が全体のテーマですよね。
 grep使って、statementだけ取り出す、とか。
 grepの作り方、という話でしょうけど。


冒頭5パラグラフ。
------------------------------------------------------------------------------
	INTRODUCTION

We are going to discuss two things in this book -- how to write programs 
that make good tools, and how to program well in the process. 

What do we mean by a tool? Suppose you have a 5000-line Pascal program 
and you need to find all references to the variable time, to make sure it can 
safely be changed from type integer to type real. How would you do it? 

One possibility is to get a listing and mark it up with a red pencil. But it 
doesn't take much imagination to see what's wrong with red-penciling a hundred 
pages of computer paper. It's mindless and boring busy-work, with lots of 
opportunities for error. And even after you've found all instances of time, you 
still can't do much, because the red marks aren't machine readable. 

Another approach is to write a simple program to find lines containing the 
identifier time. This is an improvement, for such a program is faster and more 
accurate than doing the job by hand. The trouble is that the program is so specialized 
that it will be used once by its author, then tucked away and forgotten. 
No one else will benefit from the effort that went into writing it, and something 
very much like it will have to be reinvented for each new application. 

Finding time's in a Pascal program is a special case of a general problem, 
finding patterns in text. Whoever wanted references to time today will want 
references to some other variable tomorrow, readln and writeln calls the 
day after, and next week an entirely different pattern in some unrelated text. 
Red penciling never ends. The way to cope with the general problem is to provide 
a general purpose pattern finder that will look for a specified pattern and 
print all the lines where it occurs. Then anyone can say 

	find pattern 

and the job is done. find is a tool: it uses the machine; it solves a general 
problem, not a special case; and it's so easy to use that people will use it instead 
of building their own. 
------------------------------------------------------------------------------

 おお、ちゃんとパスカル用になっている。が、内容は同じと言ってよいでしょう。
 ただ、ここまで一般的(抽象的)な問題を解決するツールを僕が開発するとは思えない
ですけどね。grep/sed/awkの使い方を十分マスターすれば良いような気がする。
まだまだ十分でないから。
 逆に、

2022/11/06  18:58    369 srch_do1.def
2022/10/29  11:23    220 srch_do2.def
2022/10/31  22:44    199 srch_do3.def
2022/10/31  23:06    209 srch_do4.def
2022/11/01  01:59    199 srch_do5.def
2022/11/01  02:13    131 srch_do6.def
2022/11/18  11:42    176 srch_do7.def
2022/11/06  18:25    321 srch_do8.def
2022/11/14  01:08    126 srch_do9.def
2022/11/16  00:15    298 srch_doa.def
2022/11/17  17:25    321 srch_dob.def
2022/11/18  11:48    240 srch_doc.def

 これらにちゃんと名前をつけて、管理せい! という感じですかね。
 あ、これ、もぐら流。中身の変更箇所がちょっとずつ違うだけ。
 これらに一般解はないです。問題のほうが"special case"だから。個別だから
偉いツール群。

 それでも、いい本っぽいと思っています。何かが得られるよう精進したいです。
 ありがとうございます。
 なお、パスカル版の翻訳はないみたいでした。


 蛇足。Pascal版 Intro pp.1-2。ページまたぎ部分。


All of them have been run without change on a variety of machines and Pascal 
compilers. 
				;A
---------------------[End of Page 1]---------------------
				;B
The second concern of this book is how to write good programs.

 このページ区切りフッタあたりに色々なノイズが入ります。Aの箇所にページとか
Bの箇所に"Introduction", "CHAPTER 1", "INSIDE THE IBM PC" (see #10359) とか。
それも壊れて化けたりもして。スペースや改行が入ったりもする。それらをVzマクロ
やsedで掃除しています。

 点検は、
>cgrep -A2 -B2 "End of "	;After & Before

 find pattern に同じ。


    - No.10427 一括表示へ   -   コメント元:10425 一括表示へ  -    [ 返信 ]    [引用無し] pre


- 関連一覧ツリー (先頭の番号をクリックするとツリー全体を一括表示します)
10387.BASM - 文太 22/11/11-12:35
  ┣10389.TSR!!! - 文太 22/11/11-13:19
  ┣10390.アセンブラ&コンパイラ、きっと NOT (neg?) - 文太 22/11/11-16:12
  ┣10391.追記 - 文太 22/11/11-16:29
  ┗10392.Re: アセンブラ&コンパイラ、きっと NOT (neg?) - としき 22/11/11-22:58
   ┗10393.Re^2: アセンブラ&コンパイラ、きっと NOT (neg?) - 文太 22/11/12-00:46
    ┣10394.PrintStrプロシージャ(asm) - 文太 22/11/12-01:12
    ┗10395.Re^3: アセンブラ&コンパイラ、きっと NOT (neg?) - としき 22/11/12-16:13
     ┣10396.Re^4: アセンブラ&コンパイラ、きっと NOT (neg?) - 文太 22/11/12-21:53
     ┗10398.Re^5: アセンブラ&コンパイラ、きっと NOT (neg?) - としき 22/11/12-23:09
      ┣10401.Re^6: アセンブラ&コンパイラ、きっと NOT (neg?) - 文太 22/11/13-00:17
      ┗10405.Re^7: アセンブラ&コンパイラ、きっと NOT (neg?) - としき 22/11/13-01:30
       ┗10408.ゲーム&ビジネス - 文太 22/11/13-14:06
        ┣10416.Re: ゲーム&ビジネス - としき 22/11/14-01:36
        ┣10422.Programming Style - 文太 22/11/14-21:21
        ┗10442.Re: Programming Style - としき 22/12/25-00:13
      ┗10402.Re^6: アセンブラ&コンパイラ、きっと NOT (neg?) - 文太 22/11/13-00:31
       ┗10404.Re^7: アセンブラ&コンパイラ、きっと NOT (neg?) - としき 22/11/13-01:01
        ┗10407.構造化 - 文太 22/11/13-13:49
         ┣10410.Re: 構造化 - 文太 22/11/13-23:36
         ┗10417.Re: 構造化 - としき 22/11/14-01:36
          ┣10420.Index of _Software Tools_ (1976) by Kernighan &am.. - 文太 22/11/14-20:56
          ┗10421.18650 - 文太 22/11/14-21:05
  ┗10397.JVM - 文太 22/11/12-21:54
   ┗10399.Re: JVM - としき 22/11/12-23:23
    ┗10400.Re^2: JVM - 文太 22/11/13-00:16
     ┗10403.Re^3: JVM - としき 22/11/13-00:53
      ┣10406.大門未知子 - 文太 22/11/13-13:03
  ┗10411.古典 - 文太 22/11/13-23:38
   ┗10424._ST in Pascal_ (1981) - 文太 22/11/18-13:07
    ┗10425.Re: _ST in Pascal_ (1981) - としき 22/11/18-16:31
     ┗10427.Re^2: _ST in Pascal_ (1981) - 文太 22/11/18-20:28
      ┣10428.Re^3: _ST in Pascal_ (1981) - としき 22/11/18-22:11
      ┗10436.Re^3: _ST in Pascal_ (1981) - 文太 22/11/28-21:22
       ┗10439.Re^4: _ST in Pascal_ (1981) - としき 22/11/30-01:49
        ┗10441.Re^5: _ST in Pascal_ (1981) - 文太 22/12/01-16:15

- 返信フォーム (この記事に返信する場合は下記フォームから投稿して下さい)   [引用無し]
おなまえ 
Eメール 
タイトル 
メッセージ auto soft pre(図表、プログラム) ※折り返さずに改行を入れてね
 参照先 
 暗証キー (英数字で8文字以内)
 プレビュー          

- 以下のフォームから自分の投稿記事を修正・削除することができます -
   処理   記事No   暗証キー
    [ページトップへ] [管理用]