Anonymous user
Stack: Difference between revisions
add Forth
m ("truth value" -> "true value") |
(add Forth) |
||
Line 165:
return !(x < y);
}
=={{header|Forth}}==
: stack ( size -- )
create here cell+ , cells allot ;
: push ( n st -- ) tuck @ ! cell swap +! ;
: pop ( st -- n ) -cell over +! @ @ ;
: empty? ( st -- ? ) dup @ - cell+ 0= ;
10 stack st
1 st push
2 st push
3 st push
st empty? . \ 0 (false)
st pop . st pop . st pop . \ 3 2 1
st empty? . \ -1 (true)
==[[Java]]==
|