Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Forth: Stack-Manipulation Operators. Parent comment
This is wrong. It should be
0 VALUE C 0 VALUE D : CAB - TO D TO C D C / ;
VARIABLE C VARIABLE D : CAB - D ! C ! D @ C @ / ;
var X # 0 var Y # 0 ( temp vars ) : dup X ! X @ X @ ; : pop X ! ; : xchg X ! Y ! X @ Y @ ; ( SWAP/exch )
There are no comments on this comment yet.
This is wrong. It should be
or Incidentally, that's exactly how I implemented DUP, DROP, and SWAP in StoneKnifeForth: (The weird names are because only the first byte of the name is significant in SKF.)