2 ms·
I've been on holiday since I left my last reply so also getting back late on this :) Everything in Rebol is just blocks of words, where (in general) expression
by draegtun 13y ago
I've been on holiday since I left my last reply so also getting back late on this :)
Everything in Rebol is just blocks of words, where (in general) expressions are evaluated from left to right; however, within each expression evaluation occurs from right to left [1].
So (infix) operators are also just words and have no precedence order so they just evaluate left to right (like Smalltalk) when parsed [2]...
>> 1 + 2 * 3
== 9
To enforce any precedence you use paren! blocks [3], which are blocks that get evaluated immediately.
>> 1 + (2 * 3)
== 7
refs:
[1] http://www.rebol.com/r3/docs/guide/code-eval.html http://www.rebol.com/r3/docs/guide/code-eval.html
[2] http://www.rebol.com/r3/docs/concepts/math-precedence.html http://www.rebol.com/r3/docs/concepts/math-precedence.html
[3] http://www.rebol.com/r3/docs/datatypes/paren.html http://www.rebol.com/r3/docs/datatypes/paren.html