Code Your Own Forth - Immediate Keyword to Run Compiled Words

Опубликовано: 10 Август 2026
на канале: Code and Crux
489
7

We are going to add the "immediate" keyword to our Forth implementation in this video. The "immediate" keyword is entered after a compiled word is defined, and it causes that compiled word to run immediately after it is defined. To implement it, all we have to do is add a Swift function and an "else if" to our big dictionary "if" statement where we will call the function.

Immediate is explained under "How to Control the Colon Compiler" here: https://www.forth.com/starting-forth/...

Write Yourself a Forth: http://beza1e1.tuxen.de/articles/fort...

Forth Standard: https://forth-standard.org

cruxForth on GitHub: https://github.com/josephkreydt/cruxF...

https://www.forth.com/

Shout out to the Swift programming language: https://swift.org/