Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Smalltalk, Self, Ruby, Io and (i think) Perl6 are examples of other languages that also do this.


Haskell 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.


Also, all methods are curried by default, meaning you can do this:

    map (*2) [1,2,3,4,5]
:)


Rebol is similar where it turns its (pre-defined) infix operators into function calls.

For eg.

    1 + 1
is transformed into...

    add 1 1




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: