|
|
|
|
|
by kazinator
3864 days ago
|
|
It's not the direction, it's the lack of delimiting. ((1 2 +) (3 4 +) *)
is fundamentally different from 1 2 3 4 + + *
Each word has a clear arity, and the arguments are delimited. We can follow the evaluation of the parenthesized expression in multiple orders and they come up with the same answer. |
|
And in Forth case, you can very easily define your own delimiters:
which should make you able to write: (tested with gforth and works [EDIT: but of course breaks Forth! Both [ and ] are already defined, so in practice you'd rather choose another chars])I mean, there is no rule saying that postfix notation cannot provide grouping constructs. I still fail to see a fundamental difference here :)
BTW, it's not going as fast as I'd like, but I managed to parse TXR man page and use it for displaying docs along auto-completion: https://github.com/piotrklibert/txr-mode/blob/master/screen....
I think I'll be able to find some time this weekend (or next weekend) to clean up the code and make it usable for others as well :)