DoDi corrected an error in my previous posting:> IMO "Let" was not optional in the very first Basic implementations, it> acted as one of the legal begin-of-statement tokens. Later this> definition was relaxed, so that an identifier would definitely begin> an assignment statement.
The moderator added:> [That's correct, Dartmouth Basic required the LET. That's one of the> reasons the compiler was so fast -- the first token always told it what> kind of statement it was. -John]

My apologies for the error. If the 1st token of every rule is unique,
it is easy to show that the grammar is LL(1). It also makes
implementing a fast recursive descent parser trivial.

Modern dialects that have made end-of-lines and line numbers optional
in BASIC are relatively far removed from the original implementation
and all include the relaxation.

However, my point was that with the relaxed definition, it is still
possible to eliminate the end-of-lines and line numbers from BASIC and
still have an unambiguous language--it just takes more look-ahead.
The resulting language is no longer LL(1), but it can still be parsed
deterministically.

There is even an LR(1) grammar for such dialects, but not one that you
would want to attach semantics to as some of the statement boundaries
get erased and have to be recovered after parsing ahead. It is much
better to simply process the new dialects with more lookahead.

Finally, as long as end-of-lines and line-numbers are required in
BASIC (and you keep the other statement starters as reserved words),
relaxing the "let" rule still results in an LL(1) grammar. The only
statement that can have a variable name after the line number is a LET
statement.

Thus, it is nor surprising that one of the early changes to the BASIC
language was making the LET keyword optional. I'm certain the
original designers never thought about BASIC as anything other than a
line-oriented language.

Therein lies a typical rub in language design. Relaxing just one minor
restriction on the language's grammar is not usually sufficient to
make the language harder to parse. However, as different restrictions
are eliminated the language can suddenly jump from easy to parse to
ambiguous. Thus, as a language designer, the more restrictions you
relax early on, the harder it will be to relax other restrictions
later.