Hacker News new | ask | show | jobs
by MaxBarraclough 879 days ago
Some related goodness from Forth: there's another word, :NONAME, for defining anonymous words. [0][1]

The more common : word enters the newly defined word into the dictionary, which is Forth speak for the newly defined word now being considered 'in scope'. The :NONAME word instead returns an execution token on the stack, which is analogous to a function pointer.

See also [2], on Forth's execution model more broadly.

[0] https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Ano...

[1] http://lars.nocrew.org/forth2012/core/ColonNONAME.html

[2] https://www.forth.com/starting-forth/9-forth-execution/