Hacker News new | past | comments | ask | show | jobs | submit login

Beautiful.

I'm a bit surprised by

    [1 2 ; .] 3
Producing

    [1 2 3]
Instead of

    3
    [1 2]



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: