In article <
[email protected]>,
Anton Ertl <
[email protected]> wrote:
Buzz McCool <[email protected]> writes:
but not h.
https://gforth.org/manual/Word-Index.html#Word-Index_fn_letter-H
Yes, I only added H. to the documentation yesterday. In general, >documentation is quite a bit behind development, and the state of the >documentation is why we have not released Gforth 1.0 yet. I document
as I find the time.
Without further comment I recite the history of adding NIP to ciforth. 1]
I was reluctant to introduce it, as it wasn't present in fig-Forth.
ROT and SWAP are changing the stack order, which is bad and is not to
be obscured. I felt that NIP was hiding a SWAP, but after all NIP
doesn't actually change the stack order. That was the reason that
Chuck Moore uses it, probably.
(New words are not added lightly to the ciforth core.)
---------------
worddoc( {JUGGLING},{NIP},{nip},{n1 n2---n2},{ISO},
{Drop the second number from the stack.},
{{DUP},{DROP},{SWAP},{OVER}},
{{S0 @ DSP! 1 2 3 4 NIP .S},{S[ 1 2 4 ]},
{S0 @ DSP!},{} },
enddoc)
CODE_HEADER({NIP},{NIP})
POP AX
POP BX
PUSH AX
_NEXT
---------------
A new word is to be preceeded by a worddoc macro.
It is explained in the documentation of the generic system cifgen.info.
(this is not the forth itself)
---------------------------------------
The 'worddoc' macro defines a structure with additional information
of a word. Generally it is placed in front of the word. The same word
can be found several times in the input file, but only one is selected
in a particular configuration. The same goes for the corresponding
'worddoc' .
Its fields are:
1. Wordset name.
2. Word name.
3. Pronunciation. This is a pure textual and pronounceable
identification of the word. It is also used in 'texinfo' that
doesn't handle special characters well.
4. Stack effect. The stack effect obeys all the conventions put forth
in the user manual.
5. Properties. Properties are i.a. immediate and such, and the
standards with which this word complies. Again this is described
in the user manual.
6. Description.
7. References. This is a list of names of other Forth words, that can
be studied to better understand this one.
8. Tests. This is a list. The first and all other odd members is a
test, code that can be passed to Forth. The second and all other
even members is the expected outcome of the preceding test.
'worddoc' are such that a structure starts with 'worddoc( ' and end
with a '})' at the end of a line. This means that a worddoc can be
simply skipped if it occurs in Forth code, by defining a word 'worddoc('
that reads and ignores source up to the end sentinel. --------------------------------------------
1] This is as far as it goes. Of course NIP was present in the library.
- anton
Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat purring. - the Wise from Antrim -
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)