Discussion: new operators for numerical computation

Carel Fellinger cfelling at iae.nl
Tue Jul 25 20:10:30 EDT 2000


Hai Math-lovers,

Very interesting discussion sofar, and clearly heading into something
nice and pythonic now.

Huaiyu Zhu <hzhu at localhost.localdomain> wrote:
> On Mon, 24 Jul 2000 20:34:40 GMT, Tim Hochberg <tim.hochberg at ieee.org> wrote:

> It seems that @op is no better than ~op in every aspect.

> So let's drop these as well. And we are left with only 
> ~op
> <op>

As a non-math Pythonier I've been reluctant to enter this debate,
though I've been planning to propose <opt> and <.some_alfanumeric_opt>
on me own. But fortunately others did, ofcourse without the proper
(that's mine:) arguments. So here I go:

(opt) looks to me as some expression on operators, not as a simple operator.
<opt> looks like an operator and was defenitely my favorite, until Huaiyu
showed us <->. It still looks like an operator, but not aka some minus but
aka some equivalence function or what have you. A big minus:( I would feel
sorry if more of those wierd symbols would enter Python. In fact the reason
I now favour ~opt is that that might open the way to get rid of those ugly
bitwise operator symbols using ~ as a generic 'element/bit-wise' prefix:

| becomes ~or,
^ becomes ~xor,
& becomes ~and, and
~ becomes ~not, reading like bitwise or, bitwise xor etc.

Much easier to remember but for ~not, besides thanks to the prefix ~
there is no need for a new xor-keyword. And as ~ is never used on its
own anymore, it's bound to be easier on the eyes in visual parsing of
expressions, and definitely better then <opt> (see below)

> a ~add b < c
> a <add> b < c

And now that w've got 'better' bitwise operator symbols we could use ^ to
mean 'to the power of' (like I always think if I forget to look it up:) and
we could use | or ~| to mean 'solve' (whatever that means).

One last thingy, the use of a leading dot in the alfanumeric opt in ~.opt
to me indicates clearly that that infix-operator has to be a method
of one of the arguments involved.


I hope I'm not making a fool of myself again, and please forgive my typos,
I'm a dyslectic on holidays and don't have a dictionary at hand.
-- 
groetjes, carel



More information about the Python-list mailing list