Overloading the tilde operator?

gatti at dsdata.it gatti at dsdata.it
Thu Feb 8 03:49:38 EST 2007


On Feb 8, 7:02 am, Dave Benjamin <r... at lackingtalent.com> wrote:
> Neil Cerutti wrote:
> > 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).
>
> You're probably thinking of SML or Haskell. OCaml also allows you to
> define new infix operators, but the associativities are fixed (and
> determined by what punctuation you use).

Also some flavours of Prolog, as descrived in the classic book by
Clocksin & Mellish.

Regarding the OP, I hope his need for an infix tilde operator is
overestimated; there are plenty of infix operators that can be abused,
and at least one of them should be unused and available for
redefinition.

Lorenzo Gatti




More information about the Python-list mailing list