Forth Namespaces and Context Switching based on VOCs, ITEMs and STICKY Words

In Forth namespaces and context switching are based on wordlists, search orders and vocabularies.

Using namespaces is encouraging concerning factoring of code into well structured source code modules and context switching could be used to define data types or simple objects. Both can make programing much more fun and can help to write readable and well structured code.

Since I discovered Forth and became familiar with the vocabulary concepts of Fig-Forth and F83, I was missing a way to bind a vocabulary (a namespace, a wordlist) to a word representing data, to create a data type or a simple object (implicit context switching).

Over the years I found a way to do it without using state-smart words, first for PC Forth Systems and during the last years also for Flash based MCU Forth Systems. VOCs, ITEMs and STICKY words are the core elements of the final concept.

With this Wiki page I will try to beam your attention towards context switching with VOCs, ITEMs and STICKY words by presenting Forth Systems that support it, examples and HOWTOs.

2019-12-18 Manfred Mahlow


430eForth43n6vis [1] for the MSP430G2553 MCU is a tiny Forth System with full support for namespaces and context switching based on VOCs, ITEMs and STICKY words [2]. It is an extended version of C.H. Tings 430eForth for the MSP430G2553 MCU, based on the naken_ASM version published by M. Kalus on GitHub.

430eForth43n6vis was created as part of a feasibility study how to extend the support for namespaces in Forth by implementing vocabulary prefixes (VOC) instead of F83 vocabularies (VOCABULARY) [3]. Wordlists, vocabulary prefixes (VOCs), <voc> ITEMs, STICKY words and related TOOLS have been added and two search orders are used, a permanent and a temporary one. For further details please read the README file that comes with the tar archive.

430eForth and Tools : 430eforth43n6vis-g2553.tar.gz (191217)

Examples and HOWTOs : 430eforth43n6vis-g2553-examples.tar.gz (191217)

[1] Namespaces and Context Switching for a Tiny Forth, VD 4/2019

[2] VOCs ITEMS und STICKY Words, Forth Tagung 2019

[3] VOC statt VOCABULARY, Forth Tagung 2019

projects/forth-namespaces/start.txt · Zuletzt geändert: 2020-01-20 18:47 von mm