Call for signatories for J2

Alex Martelli aleaxit at yahoo.com
Fri Aug 27 08:25:43 CEST 2004


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> aleaxit at yahoo.com (Alex Martelli) writes:
> > Type declarations make me cringe, but if I *had* to have them then 'b as
> > int' is the best syntax I could imagine for them offhand.
> 
> b:int worked ok in Pascal.

And "b as integer" works quite reasonably in Visual Basic -- I'm not a
VB fan, by any means, but that particular tidbit of VB syntax sugar is
(IMHO) quite good.

A precedent for a dual use of AS, quite close to what we'd have here, is
in SQL.  "SELECT foo AS bar" is a local renaming, just like Python's
"import foo as bar"; "CAST(foo AS integer)" is type coercion.  Note that
both SQL uses are good parallel for some of the 'overloads' of 'AS' in
English;-).

All in all, the argument that declarator syntax 'might' end up doing
double use for typing purposes is hardly a strong deterrent to the use
of keyword 'as' in declarator syntax.


Alex



More information about the Python-list mailing list