Are Python's reserved words reserved in places they dont need to be?

Roy Smith roy at panix.com
Wed Sep 13 05:49:09 CEST 2006


In article <1158118298.156680.7500 at m73g2000cwd.googlegroups.com>,
 "Carl Banks" <pavlovevidence at gmail.com> wrote:

> Alex Martelli wrote:
> 
> > 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;-).
> 
> Except Fortran doesn't have any reserved words either:
> 
>       PROGRAM KWDS
>       REAL REAL,WRITE
>       WRITE=1.0
>       REAL=2.0
>       WRITE(*,*)WRITE,REAL
>       END
> 
> (Not sure whether it's true in Fortran 9x.)
> 
> 
> Carl Banks

As I remember, you didn't need the whitespace either. IIRC, your example 
above could have been written as:

      PROGRAMKWDS
      REALREAL,WRITE
      WRITE=1.0
      REAL=2.0
      WRITE(*,*)WRITE,REAL
      END

and worked just as well.  I have nightmares thinking about writing a 
fortran parser.  Oh yeah, spaces were the same as zeros on input, too.  
What a wonderful language.

Isn't it wonderful how nothing you write ever gets lost once google gets 
it's hands on it:

http://mirrorspace.org/python/doc/humor/index.html#habits

(personally, I think the one about the little girl buying a wabbit in the 
pet store is the best of the collection).



More information about the Python-list mailing list