3 ms·
Smalltalk, Self, Ruby, Io and (i think) Perl6 are examples of other languages that also do this.
by draegtun 13y ago
Smalltalk, Self, Ruby, Io and (i think) Perl6 are examples of other languages that also do this.
- hesselink 13y agoHaskell also has first-class operators. Operators are infix, surrounding them with parentheses makes them prefix: (+) 1 2. Functions are prefix, surrounding them with backticks makes them infix: 1 `plus` 2. You can define your own, and define precedence and left/right associativity.
- TazeTSchnitzel 13y agoAlso, all methods are curried by default, meaning you can do this: map (*2) [1,2,3,4,5] :)
- draegtun 13y agoRebol is similar where it turns its (pre-defined) infix operators into function calls. For eg. 1 + 1 is transformed into... add 1 1