Hacker News new | ask | show | jobs
by ithkuil 997 days ago
Beautiful.

I'm a bit surprised by

    [1 2 ; .] 3
Producing

    [1 2 3]
Instead of

    3
    [1 2]
1 comments

Every function has to pop all its inputs from and push its output to the stack. the duplicate (or .) function pops one input and pushes it twice.

That is a little surprising, but making stack operations special in that they don't need to pop their arguments might be a worse option.