Hello again. While I was working on the stuff in #16 I noticed there is a point of confusion in the docs. Under the "commands" section it says "When a command requires an argument, it pops a value from the stack. If the stack is empty, a zero is provided instead."
This is not true for most of the commands; this is the internal behavior when pop is called on an empty stack, but most commands don't trigger that since they are guarded by if (count(s0) > ..) and the observed behavior is instead that the command becomes a noop. It is true for others, e.g. sum. This makes things a bit confusing and could probably stand to be clarified (or made consistent in the code if you prefer).
Again, nice project. It's been fun poking around and I appreciate how clean the code is.
Hello again. While I was working on the stuff in #16 I noticed there is a point of confusion in the docs. Under the "commands" section it says "When a command requires an argument, it pops a value from the stack. If the stack is empty, a zero is provided instead."
This is not true for most of the commands; this is the internal behavior when
popis called on an empty stack, but most commands don't trigger that since they are guarded byif (count(s0) > ..)and the observed behavior is instead that the command becomes a noop. It is true for others, e.g.sum. This makes things a bit confusing and could probably stand to be clarified (or made consistent in the code if you prefer).Again, nice project. It's been fun poking around and I appreciate how clean the code is.