From: "john gilmore" <[email protected]>
Sent: Friday, 8 October 2010 1:51 PM

My first post was remiss in not noting another important use of 
blanks-substring detection, which is due originally to
the late John Cocke.

The most important determinant of the performance of a translator--compiler, 
interpreter, assembler, whatever--is the
speed and efficiency with which it eliminates insignificant blanks from 
source-program text.

Certainly important.  For any translator, blanks can be eliminated (or skipped)
merely by searching from the end of any token (object) until either another
token is encountered, or the end of the line is encountered.
It isn't (in that case) necessary to have an instruction like TRTR
to find the end of the last token in the line, though for certain porposes
one would be handy.

I could wish things were otherwise.  Symbol-table organization is certainly of 
much greater interest, but it is also
much less important.

Apart from its obvious usefulness in processing right-to-left text like that of 
Arabic, Farsi, and Hebrew, the TRTR
instruction is valuable for locating the rightmost non-blank character in 
left-to-right text.

Quite useful if desiring to remove trailing blanks from a record.
This was done in the days of punch cards, in order to speed up
data transfers to/from disk, and to reduce disk storage requirements.
Alas, in those days, there was no TRTR instruction.

Reply via email to