On Thu, 26 Apr 2018 07:34:36 -0700, Phil Smith wrote: > >When you realized that > DO25I=1,10 >defines the start of a loop, but > DO25I=1.10 >is an assignment statement, you really wonder what about the FORTRAN compiler >parser! I'm sure it made sense at the time, and can see how it would be done, >but it still seems to me like a strange way to design a language. > Over a half century ago, a peer told me that FORTRAN, with a preliminary lexical scan, considered any statement with: o an "=" not enclosed by parentheses, and o no "," outside all parentheses ... to be an assignment statement. Anything else starts with a keyword.
A professor in the same era told his class that the oldest FORTRAN compiler parsed arithmetic expressions without using a stack. Didn't oldest BASIC interpreters (or perhaps DEC's FOCAL) require that assignments be introduced by a keyword, "SET" or "LET"? I never knew whether this was to simplify the parser or to aid novice (we all were) programmers' understanding tnat "=" meant assignment, not comparison. Some DEC interpreters put assgnment targets on the right. Some DEC shells put RENAME/COPY targets on the left (that's actually the better way.) -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
