On Tue, May 27, 2014 at 11:58:54AM -0700, Tamas Rudnai wrote: > On 18 May 2014 13:54, Byron Jeff wrote: >=20 > > A =3D 3 > > > > would require scanning through all possible keywords, reaching the > > end of the list, then deciding it must be a variable and then it's > > an assignment statement. Whereas: > > > > LET A =3D 3 > > > > is keyworded with a specific keyword which is easy to find and > > defines the semantics of the statement. > > > > Parsing the latter is much easier. > > >=20 > Would that make any difference knowing that Basic implementations on > old (70s - 80s) computers were tokenizing Basic language before > storing it in memory or on tape/disk? Usually that happens when > entering the source code from the keyboard, therefore a slow lookup > method should not be a big issue -- and after tokenization this > should not be matter as tokens are already telling the interpreter > what that is, right? You're both right, in a way. An example [1]. The Basic on the TRS-80 Model I Level II will tokenise the LET, and the equals sign, but won't tokenise the variable name or the constant. So after tokenising: LET A =3D 3 the buffer contains: 0x8c (TOKEN LET) 0x41 (ASCII A) 0xd5 (TOKEN =3D) 0x33 (ASCII 3) 0x80 (TOKEN END) The interpreter recognises variable names as different from tokens, as tokens have a high bit set. So when a variable name is encountered without a LET token, the execution vector for the LET token is used. Saves typing, which multiplied among many programmers is efficient. For me, it was one of those moments of mild disgust that coincided with my discovery of Forth. And the realisation that if code like this Basic interpreter could make money, I'm set for life! References: 1. Microsoft Basic Decoded & Other Mysteries for the TRS-80, by James Farvour, third edition, September 1981, page 8, input phase, interpretation & execution. --=20 James Cameron http://quozl.linux.org.au/ --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .