In 10.7 (and beyond) the vocabulary system in Retro has been significantly altered. Prior releases provided nestable, collapsible subsets of the global dictionary. The new approach differs by:
- no nesting
- each vocabulary is a separate dictionary list
- user controllable search order
chain: name ... functions and variables ... ;chain
A new vocabulary is created using chain: and ends with ;chain. Any functions or variables you define between these will become part of the vocabulary and are removed from the global dictionary.
By convention, vocabulary names should end with a single apostrophe (').
When creating a vocabulary, you can use the normal namespace functions to manage visibility of functions and variables. {, {{, }}, }, ---reveal---, and hide will all work as expected.
You can switch from the global dictionary to a specific vocabulary by using the name of the vocabulary directly, or add a vocabulary to the search order.
name' ...code... %%
The use of %% will switch you back to the global dictionary.
This approach is not recommended for general coding. The preferred way is to add a vocabulary to the search order.
with name'
This will add the functions in name' to the search order used by find and other functions. Vocabularies are searched first, then the global dictionary. The most recently added vocabulary will be searched first.
without
This will remove the most recently added vocabulary from the search order. If you have several vocabularies loaded and want to quickly return to just the global dictionary, use global instead:
global