6 ms·
Forth I assume uses reverse polish notation: arguments before the operator. 3 4 + for example, would return 7.
by spott 2mo ago
Forth I assume uses reverse polish notation: arguments before the operator.
3 4 +
for example, would return 7.
- zabzonk 2mo ago> would return 7 more pedantically, it would push 7 onto the stack
- dbcurtis 2mo agoeven more pedantically, would remove 3 and 4 from the stack before pushing 7
- DonHopkins 2mo agoEven oddly more pedantically, that's the operand stack, not to be confused with the separate return stack. >R and R> move values between the two stacks. On the other hand, PostScript also has a dictionary stack, which you can use to implement a Smalltalk-like object oriented programming system. And its data types and executable code are basically polymorphic homoiconic JSON (like Lisp), not raw untyped bytes like FORTH. https://news.ycombinator.com/item?id=22456471 https://news.ycombinator.com/item?id=22456471 https://news.ycombinator.com/item?id=47812317 https://news.ycombinator.com/item?id=47812317
- argimenes 2mo agoThe stack is really a convenience that makes pipeline-driven programming possible in the language.
- nagaiaida 2mo agosomewhat relatedly, shell pipelining is very amenable to being massaged into (non stack-based) concatenative programming