On 2007-02-02, Ben Finney <[EMAIL PROTECTED]> wrote:
> James Stroud <[EMAIL PROTECTED]> writes:
>> Ben Finney wrote:
>> > The Python runtime parser is designed to parse Python, not
>> > some arbitrary language that someone chooses to implement in
>> > Python.
>>
>> You haven't addressed why the limitation isn't arbitrary.
>
> Good thing I wasn't trying to do that, then. I was pointing out
> the source of the limitation.
>
> The Python syntax parser must follow the rules of the Python
> language. If you accept that premise, it follows that the '~'
> operator is unary only. If you *don't* accept that premise, I
> have no help to offer.

There's been only one (or two?) languages in history that
attempted to provide programmers with the ability to implement
new infix operators, including defining precedence level and
associativity (I can't think of the name right now).

C++, for example, works the same way as Python here. You can
override most of the operators, but you cannot change their
arity, associativity, or precedence level.

-- 
Neil Cerutti
Let us join David and Lisa in the celebration of their wedding and bring their
happiness to a conclusion. --Church Bulletin Blooper
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to