jkotlinski / durexforth

Modern C64 Forth
Other
230 stars 28 forks source link

Mostly implemented SEARCH-ORDER #271

Closed burnsauce closed 3 years ago

burnsauce commented 3 years ago

Here is a simple implementation of the SEARCH-ORDER wordset (except for SEARCH-WORDLIST).

As it is an increase in size, the cartridge will not build. (edit: it's only a few bytes off, which can be trimmed by reducing a few internal words to NONAMEs with helper functions in a different wordlist)

I don't expect this to be merged any time soon, if at all. I just put it out here as an idea, given the discussion about changes to the dictionary.

Enjoy!

edit: WORDS will need SEARCH-WORDLIST to comply with the standard: "List the definition names in the first word list of the search order." Currently, it shows the CURRENT wordlist, not the first in the search order.

MARKER will also need an update to backup and restore WIDS, _ORDER, and CONTEXT

burnsauce commented 3 years ago

The motivation for this addition is in furtherance of #269, as it appears to be the standard idiom for malleable wordlists, which could be leveraged for code compression and turn-key deployment.

This implementation would not survive the separation of the dictionary from the data space, as proposed by @jkotlinski .

It also includes a kludge to leverage _LATEST instead of rewriting compiler.asm to JSR to an updated LATEST that points to WIDS. cleaned up