Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 94:16:48 |
Calls: | 290 |
Calls today: | 1 |
Files: | 904 |
Messages: | 76,378 |
Okay let's say it out loud. Classic Forth is not fit for handling
strings.
A denotation that generates a constant string "blablabla" that has
a status as a number is long overdue.
Having a built-in string type denoted
by quotes might be a good thing. It is hard to find a argument
against that when numbers are already a comparable exception that
nobody has found a way to get rid of.
And maybe we can then even
tick strings and numbers like everything else?
On 14/08/2024 4:44 am, mhx wrote:[..]
[..]Which illustrates my point. Having a built-in string type denoted
by quotes might be a good thing.
'might be a good thing' - these would have to be the most used words
in Forth :)
mhx@iae.nl (mhx) writes:
Having a built-in string type denoted
by quotes might be a good thing. It is hard to find a argument
against that when numbers are already a comparable exception that
nobody has found a way to get rid of.
Mitch Bradley introduced parsing words for numbers, which would allow
to get rid of the number recognizers.
But yes, the mainstream is in the opposite direction: Introduce
recognizers not just for numbers, but also for strings, and a
mechanism for user-defined recognizers.
- anton--
Example
CREATE $VAR1 100 ALLOT
"AAP" \ is permanent. (somehow )
2DUP $VAR1 $! \ You take responsibilty that `$VAR is large enough
\ The constant string is still on the stack and can be reused.
On Wed, 14 Aug 2024 10:38:55 +0000, albert@spenarnc.xs4all.nl wrote:
[..]
Example
CREATE $VAR1 100 ALLOT
"AAP" \ is permanent. (somehow )
2DUP $VAR1 $! \ You take responsibilty that `$VAR is large enough
\ The constant string is still on the stack and can be reused.
Oh, now you point to an unwanted, or complicating, effect.
The phrase ' "aap" must create the string before its descriptor
can be returned. Unless, of course, "aap" exists already. A ticked
number has the same problem.
Just make that exception?
-marcel
Ticking a constant or constant string makes no sense.