Martin Ward wrote:> On Wednesday 17 Nov 2004 4:36 pm, you wrote:>>>I am not sure I agree with this. Human languages are fairly hard>>for machines to parse, yet presumably designed for humans to>>understand. In a large number of cases, I don't believe humans have>>problems with keywords used as identifiers,

> Humans very rarely use keywords as identifiers: how many (English)> people do you know who are called "The" or "And"?> "Pass me the the will you, And?" is not immediately obvious.>> More seriously, humans are good at pattern matching: with a small> number of keywords (and properly indented code) a human can pick out> the keywords instantly and work out the overall structure of a chunk> of code very quickly. When keywords are also used as identifiers,> this is not possible.>> So the real solution to the problem of lots of keywords (where a> programmer might use an unfamiliar keyword as an identifier) is simply> to define fewer keywords and *not* to use unique keywords for rarely> used constructs in the language.

I fail to see the problem. Of course a rational programmer isn't
going to use "IF" and "ELSE" as variables, but the X11 example
recently given shows the obnoxiousness or having keywords as reserved
words. "CLASS" is a perfectly good name for a variable.

I hadn't really noticed too many problems parsing PL/I. Most
ambiguous cases require only a one- or two-token look-ahead to
resolve, rarely more.