3 ms·
Mathematica is a pretty good example of a language that introduces some syntax without compromising on homoiconicity. For example a := {1 + 2 - 10, 10, {1,
by auganov 11y ago
Mathematica is a pretty good example of a language that introduces some syntax without compromising on homoiconicity.
For example
a := {1 + 2 - 10, 10, {1, 2}}
is just
Set[a, List[Plus[1, 2, -10], 10, List[1, 2]]]
- draegtun 11y agoRebol 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