I was to modify the metacompiler of noforth to make it more
portable, using i.a. ciforth. https://github.com/WillemOuwerkerk/noForth-T-for-the-RP2040
Enters +TO. If you add VALUE to a Forth and you don't have
+TO, how would you define it? ( Fortunately ciforth has it,
besides the implementation of TO is in source and hints to
the implementation of +TO ).
Untested:
: +TO >IN @ >R BL WORD COUNT EVALUATE + R> >IN ! ['] TO EVALUATE ;
Compares this to a missing +! .
Untested:
: +! SWAP OVER @ + SWAP ! ;
Groetjes Albert
I was to modify the metacompiler of noforth to make it more
portable, using i.a. ciforth. https://github.com/WillemOuwerkerk/noForth-T-for-the-RP2040
Enters +TO. If you add VALUE to a Forth and you don't have
+TO, how would you define it? ( Fortunately ciforth has it,
besides the implementation of TO is in source and hints to
the implementation of +TO ).
Untested:
: +TO >IN @ >R BL WORD COUNT EVALUATE + R> >IN ! ['] TO EVALUATE ;
Compares this to a missing +! .
Untested:
: +! SWAP OVER @ + SWAP ! ;
Groetjes Albert
On 12-10-2026 09:56, albert@spenarnc.xs4all.nl wrote:
I was to modify the metacompiler of noforth to make it more
portable, using i.a. ciforth.
https://github.com/WillemOuwerkerk/noForth-T-for-the-RP2040
Enters +TO. If you add VALUE to a Forth and you don't have
+TO, how would you define it? ( Fortunately ciforth has it,
besides the implementation of TO is in source and hints to
the implementation of +TO ).
Untested:
: +TO >IN @ >R BL WORD COUNT EVALUATE + R> >IN ! ['] TO EVALUATE ;
Compares this to a missing +! .
Untested:
: +! SWAP OVER @ + SWAP ! ;
Groetjes Albert
Agreed, I don't like parsing words either in 4tH. All of these are hard
coded in my compiler (fifth column):
...
{ 2, 0, -2, "#!", EOL, DoComment },
{ 2, 0, -1, ",\"", "\"", DoCommaQuote },
{ 2, 0, -1, ",|", "|", DoCommaQuote },
{ 2, 0, -1, ".\"", "\"", DoDotQuote },
{ 2, 0, -1, ".(", ")", DoDotQuote },
{ 2, 0, -1, ".|", "|", DoDotQuote },
{ 2, 0, -2, "C,", "", DoCComma },
{ 2, 0, -2, "C\"", "\"", DoCQuote },
{ 2, 0, -2, "C|", "|", DoCQuote },
{ 2, 0, 1, ">=", "", DoGreaterEqual },
{ 2, 0, 1, "<=", "", DoLessEqual },
{ 2, 0, -1, "S\"", "\"", DoSQuote },
{ 2, 0, -1, "S|", "|", DoSQuote },
...
Before I had the preprocessor, there was no way to add any new ones
without adding a token and recompiling the whole shebang. TO, however,
is *NOT* one of my parsing words in the strictest sense. Still, without
the preprocessor I cannot handle them without changing the compiler.
I know that not all parsing words can be eradicated, but I wouldn't be >unhappy if there were less. ;-)
Hans Bezemer--
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 54:23:53 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,563 |