7 ms·
In Forth parsing doesn't even come into play, because an operator just tries to pop as many arguments off the stack as it needs. Annoyingly, that does mean ther
by tmtvl 2y ago
In Forth parsing doesn't even come into play, because an operator just tries to pop as many arguments off the stack as it needs. Annoyingly, that does mean there's no way to tell what the following:
a b +
Means, as it can be any of these, for example:
add(b, a)
add(b(a))
add(b(a()))
add(b(), a())
add(b, a())
add(b(), a)
In a language where you don't need brackets for function calls it can be reduced to:
add b, a
add b a
And even if the add function takes two arguments the second option would be fine because the call:
b a
May put two arguments on the stack.
add(b(), a())