My Fifth Rethink on Execution Tokens

In which I continue my war against associated values In my previous post, I ended by trying to eliminate the CompiledWord cases that use associated values. These are: case parsedLiteral(Int) case undefined(Word) case redefined(Word) case definition(Cell) I've got rid of the last of these, but it was a difficult struggle. I did it by introducing … Continue reading My Fifth Rethink on Execution Tokens

Forth: Cleaning up the execute loop

In which I simplify the execution cycle Every word now has an execution token and most words are interpreted using the function execute(token:,wordStream:,index:, output:). There are still a couple of words that have to be executed outside of this due to their CompiledWord having an associated value. Thus we have this ugly bit of code: … Continue reading Forth: Cleaning up the execute loop