Discussion: new operators for numerical computation

Carel Fellinger cfelling at iae.nl
Mon Jul 31 17:55:06 EDT 2000


Huaiyu Zhu <hzhu at users.sourceforge.net> wrote:
> On 26 Jul 2000 02:10:30 +0200, Carel Fellinger <cfelling at iae.nl> wrote:
...
>>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).

> "solve" is simply "left division", like (if | is solve)
...

This must be the number one reason for me to spell most of this newsgroup,
one but hinges at not understanding something to get a decent explanation.
So reading is an ongoing education experience. Thanks.

> BTW, if we ever desire to extend python in the future with general named
> operators, perhaps @opname is a better choice because @ is associated
> visually more closely with letters.  In any case, these two extensions are

And that is why it's not so good too, whithout intermingled whitespace it
becomes difficult for the eye to spot where the left operant ends, like in:

>>> confusion = some at ne(somethingelse)  ### not a function call

> of different categories. The ~op retain the precedence of existing op, while
> the @opname type would have to share one fixed precedence if they are more
> functionlike.

No need to use two different starting symbols, one suffices I think.

  all ~op, where op in [+....], have precedence of op,
  but all ~op, where op is identifier, share the same fixed precedence.
-- 
groetjes, carel



More information about the Python-list mailing list