Other notes

Andrew Dalke dalke at dalkescientific.com
Wed Dec 29 22:37:38 EST 2004


Bengt Richter:
> OTOH, there is precedent in e.g. fortran (IIRC) for named operators of the
> form .XX. -- e.g., .GE. for >= so maybe there could be room for both.

> Hm, you could make
> 
>      x .infix. y


>   x .op1. y .op2. z => op2(op1(x, y), z)

The problem being that that's already legal syntax

>>> class Xyzzy:
...   def __init__(self):
...     self.op1 = self.op2 = self.y = self
...     self.z = "Nothing happens here"
... 
>>> x = Xyzzy()
>>> x .op1. y .op2. z
'Nothing happens here'
>>> 

				Andrew
				dalke at dalkescientific.com




More information about the Python-list mailing list