4 ms·
Stacks are reference types, the operation doesn't produce any new values. Half the time you want it there to push more items, or to display it in the REPL like
by codr7 7y ago
Stacks are reference types, the operation doesn't produce any new values. Half the time you want it there to push more items, or to display it in the REPL like in this case, but the other half you're going to drop it anyway.
I'm still undecided on the stack ops. There is one case in forthy2 where a reference is left on the stack, and that is splicing values into forms [0], where it's more likely you want to keep working with the same form. More likely is not a very good heuristic for designing API's though, so I might just go with the behavior you expected.
[0] https://github.com/codr7/forthy2#quoting https://github.com/codr7/forthy2#quoting