Static typing (was Re: Java guy interested in Python)

Michael Hudson mwh21 at cam.ac.uk
Sun Mar 11 18:06:53 EST 2001


"Alex Martelli" <aleaxit at yahoo.com> writes:

> "Michael Hudson" <mwh21 at cam.ac.uk> wrote in message
> news:m3hf1080or.fsf at atrus.jesus.cam.ac.uk...
[snip]
> > > int is no "reserved word", after all.
> >
> > Yes it is.  "identifier" and "keyword" are disjoint classes of token
> > in C++, at least by my reading of the 1997-12 working draft I've just
> > dredged up with google.
> >
> > Unless I've missed some subtle joke...
> 
> Sorry, too subtle -- the point was meant to be that a #define int
> foo _would_ make it legal (and incomprehensible to anybody, if the
> #define is well-hidden enough) -- sort of trying to see who'd fail
> to spot this.  But on re-reading it falls pretty flat -- sorry!

Actually, I thought

#define int foo

was pedantically illegal C++ that was almost certain to work, but on
checking I see that it's probably legal.  I also hadn't taken this
possibility into account when replying above; catching people out with
the preprocessor isn't really fair...

Cheers,
M.

-- 
  Those who have deviant punctuation desires should take care of their
  own perverted needs.                  -- Erik Naggum, comp.lang.lisp



More information about the Python-list mailing list