logoalt Hacker News

ajhenrydevyesterday at 9:18 PM4 repliesview on HN

Can someone explain for me?


Replies

e12eyesterday at 9:53 PM

A different way to say the same: in forth, words get pushed on the stack, and popped from the stack by words that take arguments:

    code           stack
    I Forth love

    Forth love     I

    love           I
                   Forth

    ; love presumably pops
    ; subject, object args
    ; from stack - and does something 
    ; perhaps prints as side effect
show 2 replies
spottyesterday at 9:22 PM

Forth I assume uses reverse polish notation: arguments before the operator.

3 4 +

for example, would return 7.

show 2 replies
HFguyyesterday at 9:23 PM

Forth uses RPN so the "verb" is last.

That is, you provide the data first (I and Forth) and the command (heart) last.

show 1 reply