News for hackers. Stuff that matters.
Re:Stack-Oriented Programming by int_19h on Tuesday January 14, 2020 @10:32PM (#22051549)
Immediate words in Forth are somewhat analogous to macros, and therefore can do this kind of stuff if need be - not evaluating something, or evaluating something several times. Take a look at a sample implementation of IF/ELSE/THEN and DO/LOOP: https://github.com/nornagon/jonesforth/blob/4f853252f715132e...

Forth also has anonymous words (:NONAME), so you can dynamically define a computation and pass it around on the stack, and later execute it. I don't think there's any way to clean them up, though (no GC).

There are no comments on this comment yet.