3 ms·
Common Lisp can do the same thing, and people typically prefer returning a product type because capturing multiple return values invariably introduces some extr
by derleth 13y ago
Common Lisp can do the same thing, and people typically prefer returning a product type because capturing multiple return values invariably introduces some extra syntax.
Forth functions (or words, if you insist) can return multiple values as easily as they can return a single value, but the stack metaphor makes this a lot more natural. This is also true of Joy and RPL and other languages which are conceptually organized around mutating a (notional) stack. Multiple return values only become unnatural when you choose an abstraction other than the stack.
- anaphor 13y agoI have used RPL (I have an HP 50G) and yeah, you can do some fun stuff with the stack. Although I wish they would just port Factor to it already :P