en:pfw:library
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:pfw:library [2024-09-04 13:15] – [The viewer] willem | en:pfw:library [2025-02-06 17:59] (current) – [A library for Forth] willem | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== A library for Forth ====== | ====== A library for Forth ====== | ||
+ | |||
+ | *W.O.* | ||
Line 9: | Line 11: | ||
The interface consists of the following word: '' | The interface consists of the following word: '' | ||
- | * '' | + | * '' |
An optional word as suggested by Ulrich Hoffmann | An optional word as suggested by Ulrich Hoffmann | ||
Line 15: | Line 17: | ||
Optional words as suggested by Willem Ouwerkerk | Optional words as suggested by Willem Ouwerkerk | ||
- | * '' | + | * '' |
+ | * '' | ||
* '' | * '' | ||
* '' | * '' | ||
Line 65: | Line 68: | ||
They act as separators and are not part of the text itself. | They act as separators and are not part of the text itself. | ||
- | The '' | + | The '' |
- | Note that: The library starts with a dummy '' | + | |
- | * '' | + | * chapter-1 '' |
The '' | The '' | ||
* line-1 '' | * line-1 '' | ||
- | The first line of each library chapter starts with case insensitive keyword(s) separated by spaces. The word '' | + | The first line of each library chapter starts with a case insensitive keyword. The word '' |
backslash to prevent the keywords for being executed while loading a chapter. Then it adds all source code until the ''< | backslash to prevent the keywords for being executed while loading a chapter. Then it adds all source code until the ''< | ||
The end of the library is kept in a pointer that is updated when we extend the library.\\ | The end of the library is kept in a pointer that is updated when we extend the library.\\ | ||
Line 113: | Line 116: | ||
< | < | ||
- | Function: NEEDED | + | Function: NEEDED |
a) Save the string a +n and make the string uppercase | a) Save the string a +n and make the string uppercase | ||
b) If this string is already present in the dictionary, do nothing | b) If this string is already present in the dictionary, do nothing | ||
Line 120: | Line 123: | ||
e) When a keyword is not found issue an error message | e) When a keyword is not found issue an error message | ||
| | ||
- | Function: NEED ( " | + | Function: NEED |
a) Parse the next word form the input stream and perform the function of NEEDED | a) Parse the next word form the input stream and perform the function of NEEDED | ||
Line 276: | Line 279: | ||
</ | </ | ||
- | ===== The viewer ===== | + | ===== A viewer |
This viewer shows 16 or less lines at a time. | This viewer shows 16 or less lines at a time. | ||
Line 425: | Line 428: | ||
==== A little extra ==== | ==== A little extra ==== | ||
- | Loading a lot of library code in one go. it is used like this: '' | + | Loading a lot of library code in one go. It must be used like this: '' |
Note that '' | Note that '' | ||
en/pfw/library.1725448546.txt.gz · Last modified: 2024-09-04 13:15 by willem