Are Python's reserved words reserved in places they dont need to be?
aleax at mac.com
Wed Sep 13 05:12:47 CEST 2006
metaperl <metaperl at gmail.com> wrote:
Yes, keywords are always reserved. The one major language that tried to
do otherwise was PL/I, where you could code, e.g.:
if if = if then then = else else else = if
((of course, '=' was also polimorpically read as either assignment OR
comparison -- I gather that most Basic dialects still do that!-)).
IBM (PL/I's inventor and rabid defender) found out the hard way that
making the parser more complicated, slow and bug-prone in order to allow
such absurd obfuscation was NOT a popular trade-off -- despite IBM's
alleged monopoly power, PL/I is now basically dead while the older,
crankier languages that PL/I wanted to replace, Cobol and particularly
Fortran, are still quite alive (and with reserved words ALWAYS reserved
-- like in C, Python, Java, C#, Haskell, and basically every language
that's even halfway sensible;-).
> Is Python 3k going to fix this sort of thing?
Fortunately not, or we'd all be busy studying Ruby or Boo!-)
More information about the Python-list