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

Alex Martelli aleaxit at yahoo.com
Sun Mar 11 17:08:48 EST 2001


"Michael Hudson" <mwh21 at cam.ac.uk> wrote in message
news:m3hf1080or.fsf at atrus.jesus.cam.ac.uk...
    [snip]
> > > Since that's all "int i;" *can* mean in C++, seems tautological
<wink>.
> >
> > Surely you're joking, Mister Peters?
> >
> >     class int {
    [snip]
> > Isn't this perfectly legal C++
>
> No.
>
> > , meaning something very different from "i behaves like an integer
> > variable"...?  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!


Alex






More information about the Python-list mailing list