Get the latest tech news

Implementing DOES> in Forth, the entire reason I started this mess


Implementing DOES> in Forth, the entire reason I started this mess

Somehow, it needs to modify the newly created word to not only push the address of its body onto the stack, but execute the code that appears after itself. This is a small extension to forth_core_create that does the double duty of pushing the address of the body onto the stack, and setting things up to run the Forth code compiled just after that instruction: I suspect the reason why JonesForth didn't implement DOES> has to do with the direct subroutine call in the middle of a Forth word.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of mess

mess

Photo of Forth

Forth

Photo of entire reason

entire reason

Related news:

News photo

Microsoft agrees that USB is a mess and it's making changes to fix it: 'Manufacturers can implement ports that look identical but differ wildly in functionality'

News photo

Smart glasses are a mess, but Android XR should finally fix that

News photo

Moving Forth: a series on writing Forth kernels