(Assuming you *have* FORGET).
It is also messy to write a definition that needs words from different vocabularies.
With vocabularies it quickly becomes a pain when,
e.g., defining words in A, switching to B to define
something there, go back to A and define some more
words ... At least it is when trying to FORGET stuff.
(Assuming you *have* FORGET).
It is also messy to write a definition that needs
words from different vocabularies.
( Like a book with footnotes that span multiple pages,
or where a chapter can not be read on its own. )
With vocabularies it quickly becomes a pain when,
e.g., defining words in A, switching to B to define
something there, go back to A and define some more
words ... At least it is when trying to FORGET stuff.
(Assuming you *have* FORGET).
It is also messy to write a definition that needs
words from different vocabularies.
( Like a book with footnotes that span multiple pages,
or where a chapter can not be read on its own. )
How did you solve that complexity?
On 31 Oct 2024 at 17:30:45 CET, "mhx" <mhx> wrote:
With vocabularies it quickly becomes a pain when,
e.g., defining words in A, switching to B to define
something there, go back to A and define some more
words ... At least it is when trying to FORGET stuff.
(Assuming you *have* FORGET).
The FORGET issue is mostly a red herring because of compile speed; for
code less than 100k lines we use EMPTY to clean the dictionary and then
start again. 1M lines of code take about 30 seconds to compile.
It is also messy to write a definition that needs
words from different vocabularies.
( Like a book with footnotes that span multiple pages,
or where a chapter can not be read on its own. )
How did you solve that complexity?
Gerald Wodni implemented the VOC-DOT notation for VFX as a
recogniser. To reference a word in another vocabulary, just use
<voc>.<word>
This notation has proven to be very useful, especially when dealing
with a range of byte-oriented serial devices, e.g:
i2c.emit
spi.emit
The notation also reads well. I have no idea who invented it originally
and where the original source code is.
Stephen Pelc, stephen@vfxforth.com
On 31 Oct 2024 at 17:30:45 CET, "mhx" <mhx> wrote:
It is also messy to write a definition that needs
words from different vocabularies.
( Like a book with footnotes that span multiple pages,
or where a chapter can not be read on its own. )
How did you solve that complexity?
Gerald Wodni implemented the VOC-DOT notation for VFX as a
recogniser. To reference a word in another vocabulary, just use
<voc>.<word>
This notation has proven to be very useful, especially when dealing
with a range of byte-oriented serial devices, e.g:
i2c.emit
spi.emit
The notation also reads well. I have no idea who invented it originally
and where the original source code is.
mhx <mhx@iae.nl> wrote:
(Assuming you *have* FORGET).
FORGET is relic
Such a syntax is used in SP-Forth/4 since 2001, in the form <voc>::<word> or <voc1>::<voc2>::<word>
Where <voc> is a word that returns wid, or a word that is created with `vocabulary`.
This syntax in SP-Forth probably came after C++ "::" operator, introduced in 1998. The same operator was in C# from its initial release in 2000.
The dot "." operator for accessing nested packages in Java was introduced in 1995.
In Forth, a dot is often used as part of plain names, so it was less suitable as
a namespace separator.
On 2024-11-01 16:06, Stephen Pelc wrote:
On 31 Oct 2024 at 17:30:45 CET, "mhx" <mhx> wrote:
It is also messy to write a definition that needs
words from different vocabularies.
( Like a book with footnotes that span multiple pages,
or where a chapter can not be read on its own. )
How did you solve that complexity?
Gerald Wodni implemented the VOC-DOT notation for VFX as a
recogniser. To reference a word in another vocabulary, just use
<voc>.<word>
This notation has proven to be very useful, especially when dealing
with a range of byte-oriented serial devices, e.g:
i2c.emit
spi.emit
The notation also reads well. I have no idea who invented it originally
and where the original source code is.
Such a syntax is used in SP-Forth/4 since 2001, in the form
<voc>::<word> or <voc1>::<voc2>::<word>
Where <voc> is a word that returns wid, or a word that is created with `vocabulary`.
This syntax in SP-Forth probably came after C++ "::" operator,
introduced in 1998. The same operator was in C# from its initial
release in 2000.
The dot "." operator for accessing nested packages in Java was
introduced in 1995.
In Forth, a dot is often used as part of plain names, so it was less suitable as a namespace separator.
In Forth, a dot is often used as part of plain names, so it was less suitable as a namespace separator.
On 2024-11-01 10:28, Ruvim wrote:
Such a syntax is used in SP-Forth/4 since 2001, in the form
<voc>::<word> or <voc1>::<voc2>::<word>
Where <voc> is a word that returns wid, or a word that is created with
`vocabulary`.
This syntax in SP-Forth probably came after C++ "::" operator,
introduced in 1998. The same operator was in C# from its initial
release in 2000.
The dot "." operator for accessing nested packages in Java was
introduced in 1995.
In Forth, a dot is often used as part of plain names, so it was less
suitable as a namespace separator.
Yep. Bad idea to use dot.
Never liked `::`, found it visually distasteful.
Dare I suggest C's `->` which trumps others by decades.
Or simply create a new one like `:>` or `~` (oh I'll be stoned for this one). I would prefer a single character, but there are so few good choices.
FORGET is relic
I still use it for quickies:
0 VALUE FOO ' FOO @ FORGET FOO CONSTANT DOEVAL
0 0 2VALUE FOO ' FOO @ FORGET FOO CONSTANT DOE2VAL
0 0 2CONSTANT FOO ' FOO @ FORGET FOO CONSTANT DOE2CON
Puzzling. What the hell is hiding in the first cell of ' FOO ?
Puzzling. What the hell is hiding in the first cell of ' FOO ?
Pointer to code following a DOES> . The pointed-to address can be
used to identify the type of a defined word.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 994 |
Nodes: | 10 (0 / 10) |
Uptime: | 97:19:42 |
Calls: | 13,016 |
Calls today: | 2 |
Files: | 186,574 |
Messages: | 3,282,095 |