Proposal: allow '?' and '!' in identifiers

David Allen s2mdalle at titan.vcu.edu
Mon Feb 19 22:17:09 EST 2001


In article <96sh22$jq5$1 at news.mathworks.com>, "Joshua Marshall"
<jmarshal at mathworks.com> wrote:

> Anybody have any thoughts on allowing the characters '!' and '?' in
> identifiers?  It's possible I'm missing something, but I think the only
> ambiguity this introduces is in the case of something like the following:
> 
>   a!=b
> 
> But whitespace easily disambiguates ("a! = b" vs "a != b").
> 
> The only snag I see is in the lexer.  For backward compatibility, "a!=b"
> would need to be lexed as "a != b", but this may be unexpected, since the
> lexer is currently greedy, trying to make tokens as large as possible before
> moving on.
> 
> If the addition of '!' as a valid identifier character causes too many
> waves, it would still be nice to see '?'.

Why?  How would this make the language more expressive?
How would it make your programming tasks easier?

Is introducing new and strange behavior (such as your
a!=b example) worth it?  Why?

-- 
David Allen
http://opop.nols.com/
----------------------------------------
Diplomacy is the art of saying "nice doggy" until you can find a gun.



More information about the Python-list mailing list