4 ms·
Forth actually has two stacks. Lisp has garbage-collected storage and environment structures, and Forth does not need them. :) Logo is a Lisp-like language whi
by RodgerTheGreat 14y ago
Forth actually has two stacks. Lisp has garbage-collected storage and environment structures, and Forth does not need them. :)
Logo is a Lisp-like language which uses prefix notation but does not require parentheses surrounding every procedure invocation. Your example could be written as:
product 5 sum 3 2
Parens are allowed for adding clarity and are only required for a vararg-style invocation. The main downside of this approach is that it is necessary to know the arity of every procedure in an expression to unambiguously parse it- Logo implementations typically either defer some safety checks to runtime or compile in two passes. Forth doesn't have this problem because it doesn't parse expressions per se- it compiles and interprets as it goes along.