4 ms·
Rebol is another homoiconic language that has infix operators: >> 1 + 2 * 3 == 9 The Rebol interpreter see this as: >> multiply add 1 2 3 == 9 Func
by draegtun 11y ago
Rebol is another homoiconic language that has infix operators:
>> 1 + 2 * 3
== 9
The Rebol interpreter see this as:
>> multiply add 1 2 3
== 9
Functions in Rebol have fixed arity, both add and multiple take two arguments. You can express the above with parens if you want to make it clearer:
>> multiply (add 1 2) 3
== 9
Rebols infix operators have no precedence they just work left to right (like Smalltalk). Use parens where needed!
>> 1 + (2 * 3)
== 7