mutable default parameter problem [Prothon]

Mark Hahn mark at prothon.org
Tue Jun 29 02:49:56 EDT 2004


Paul Rubin wrote:
> "Mark Hahn" <mark at prothon.org> writes:
>> Yes, a Prothon identifier is the same as a Python identifier except
>> that it can end with an exclamation mark ( ! )or a question mark ( ?
>> ).  These marks can only appear at the end and there can only be
>> one.  It is up to the programmer to make sure he/she uses them
>> properly.
>
> How do you parse
>
>       a!=b

As a! = b.  Symbols are extracted by the lexer from left to right.  Luckily
accidently typing "a != b" as "a!=b" would cause a parser error since
assignments aren't legal in expressions.

Now that I see this example, maybe it would be a good idea to not allow it
because of it's ambiguity.  I'll put that up for a vote on our list.





More information about the Python-list mailing list