On 8/05/2025 6:39 pm, LIT wrote:
Aimless fiddlers should just switch to Forth.
In next 20 years they'll figure out how to FORGET
a function.
I can't remember the last time I forgot something.
On 08-05-2025 11:30, dxf wrote:
On 8/05/2025 6:39 pm, LIT wrote:Actually - I use it daily. Note that 4tH has no word sets and no
Aimless fiddlers should just switch to Forth.
In next 20 years they'll figure out how to FORGET
a function.
I can't remember the last time I forgot something.
namespaces. Coming from C - I never felt I needed them. What I *did*
have was "static" - which allowed me to hide those functions which
weren't important for the API of that module.
So I added HIDE to 4tH, to clean up modules for that very purpose.
Usually, all non-public words are named like (NAME) - according to the
rules set in "Thinking Forth". Which already helps to avoid any
collisions, since even *if* they were previously used, they would be
hidden by now.
So its' not uncommon to see some - or even rather large - lists of HIDEs
at the end of a module. Note I don't have to do them by hand, this one
does it for me: >https://sourceforge.net/p/forth-4th/code/HEAD/tree/trunk/4th.src/makehide.4th
Other Forths had HIDE, so I borrowed it. There is no UNHIDE or
equivalent because 4tH can't. The thing is thrown out of the symbol
table completely on HIDE.
Also, the size of the symbol table is determined by (amongst others)
HIDE. Defining words expand the size of the symbol table, HIDE reduces
it. That's why you can't make HIDE act conditionally by [IF] and [THEN]
- since at that stage, the system is unable to evaluate such expressions.
Hans Bezemer
On 08-05-2025 11:30, dxf wrote:
On 8/05/2025 6:39 pm, LIT wrote:Actually - I use it daily. Note that 4tH has no word sets and no
Aimless fiddlers should just switch to Forth.
In next 20 years they'll figure out how to FORGET
a function.
I can't remember the last time I forgot something.
namespaces. Coming from C - I never felt I needed them. What I *did*
have was "static" - which allowed me to hide those functions which
weren't important for the API of that module.
So I added HIDE to 4tH, to clean up modules for that very purpose.
Usually, all non-public words are named like (NAME) - according to the
rules set in "Thinking Forth". Which already helps to avoid any
collisions, since even *if* they were previously used, they would be
hidden by now.
So its' not uncommon to see some - or even rather large - lists of HIDEs
at the end of a module. Note I don't have to do them by hand, this one
does it for me: https://sourceforge.net/p/forth-4th/code/HEAD/tree/ trunk/4th.src/makehide.4th
Other Forths had HIDE, so I borrowed it. There is no UNHIDE or
equivalent because 4tH can't. The thing is thrown out of the symbol
table completely on HIDE.
Also, the size of the symbol table is determined by (amongst others)
HIDE. Defining words expand the size of the symbol table, HIDE reduces
it. That's why you can't make HIDE act conditionally by [IF] and [THEN]
- since at that stage, the system is unable to evaluate such expressions.
My lisp namespace totally hides there is a Forth underneath.
On Thu, 8 May 2025 11:11:52 +0000, albert@spenarnc.xs4all.nl wrote:
[..]
My lisp namespace totally hides there is a Forth underneath.
Why? I think it is useful to add lisp functions to a Forth
program if that is appropriate to the task at hand. Or
even more useful if one could add Forth words to a lisp
interpreter that is written in Forth (like I did for the tinykiss
compiler https://iforth.nl/crenshaw/mchapter17/tinykiss.frt ).
-marcel
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:54:57 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,093 |