How about "print file=yonder, yo, de, do"

Martin von Loewis loewis at informatik.hu-berlin.de
Tue Sep 5 11:45:21 EDT 2000


"Jeff Petkau" <jpet at eskimo.com> writes:

> One more random stab at a different syntax, just
> because this dead horse ain't been flogged enough.
> 
> How about this syntax:
> 
>     print file=myfile, 1, 2, 3

So who will go around and shoot down all proposals that won't work?
For example, this one doesn't, either.

> - no parser ambiguity, since assignment is not legal in an expression;
>   it parses just like an argument list.

The problem is that the parser can't tell. It's a recursive-descent
parser, which has to decide on an action when it sees 'file'. It can't
know whether this NAME token is the beginning of the special file
syntax, or part of an expression, like

      print file==myfile,1,2,3

would be.

So any volunteers to rewrite the Python parser?

Regards,
Martin



More information about the Python-list mailing list