On 2024-08-05 14:04, albert@spenarnc.xs4all.nl wrote:...
In article <v8nrb0$3vbpv$3@dont-email.me>,
Ruvim <ruvim.pinka@gmail.com> wrote:
But if you hate parsing words in principle (just because they do
parsing), why not hate such long parsing words like `[if]`, `\`, the
construct "]]...[[", etc? What is an alternative for them?
I meant the word `[IF]` by itself, without connection with `WANT`.
The word `]]` is also a parsing word (in a standard-compliant >implementation).
How to implement such functionality without active parsing the input stream?
But if such long parsing words like `[IF]` and `]]` are acceptable, why
the words that parses a single lexeme are not acceptable? (apart from
naming and terminator visibility problems)?
In article <v8nrb0$3vbpv$3@dont-email.me>,
Ruvim <ruvim.pinka@gmail.com> wrote:
On 2024-08-04 15:11, albert@spenarnc.xs4all.nl wrote:
Particularly I hate ' / ['] .
My solution that ' has to elevated to a denotation.
Meaning 'someword leave the address/dea/handle/nametoken
of `` someword '' that is the same in interpret and compile mode.
I also often use `'someword` instead of `['] someword` and `' someword`, >>> because I hate different forms for the conceptually same thing in
interpretation and compilation, and because the form `'someword` is shorter.
Another thing I hate is when it's not obvious that a word is a parsing
word, or what its delimiter. So I prefer when parsing delimiters are
visible.
For example, I would prefer:
want( word1 word2 word3 )
rather than:
want word1 want word2 want word3
I have changed WANT to accept several words on the same line
want word1 word2 word3
This is one of the few "improvements" I'm not sure about.
By itself WANT is a concession because it is actually
"word1" WANTED "word2" WANTED "word3" WANTED
Your proposal makes sense, having several WANT(ED) on the same line
is ugly and impractical, but parsing to the end of line is dubious.
But if you hate parsing words in principle (just because they do
parsing), why not hate such long parsing words like `[if]`, `\`, the
construct "]]...[[", etc? What is an alternative for them?
WANT is used recursively in blocks. If you wanted to accomplish the
same thing with [IF], it would be a horrid mess.
I meant the word `[IF]` by itself, without connection with `WANT`.
The word `[IF]` is a parsing word. If you hate parsing words in general,
what alternative to `[IF]` could you suggest?
The word `]]` is also a parsing word (in a standard-compliant >implementation). It parses the input stream till the lexeme "[[".
How to implement such functionality without active parsing the input stream?
But if such long parsing words like `[IF]` and `]]` are acceptable, why
the words that parses a single lexeme are not acceptable? (apart from
naming and terminator visibility problems)?
Ruvim
For example, in "C++":
/*
// /* comment */ puts("you should see this");
// the above command takes effect despite the line comment
/* other comment */
A rule of thumb: the one who gains control first wins.
On 2024-08-05 18:33, Anton Ertl wrote:
Ruvim <ruvim.pinka@gmail.com> writes:
I meant the word `[IF]` by itself, without connection with `WANT`.
Not necessarily a parsing word. Could also be treated as something
like another state (i.e., the text interpreter does the parsing, but
does something different with the words than interpretation state or
compile state.
In every case, the interaction with other features is
problematic; e.g., consider:
0 [IF]
...
\ ....
\ [ELSE]
\ ....
cr .( you should see this according to the standard)
[THEN]
(and the systems I tested actually comply with the standard requirements)
This behaviour might surprise users, especially in connection with
nested [IF]s. However, there have been few complaints, so it
obviously is only a minor issue.
This problem is not endemic to Forth. It takes place in many other >programming languages too.
For example, in "C++":
/*
// /* comment */ puts("you should see this");
// the above command takes effect despite the line comment
/* other comment */
A rule of thumb: the one who gains control first wins.
Ruvim
Ruvim <ruvim.pinka@gmail.com> writes:
On 2024-08-05 14:04, albert@spenarnc.xs4all.nl wrote:...
In article <v8nrb0$3vbpv$3@dont-email.me>,
Ruvim <ruvim.pinka@gmail.com> wrote:
But if you hate parsing words in principle (just because they do
parsing), why not hate such long parsing words like `[if]`, `\`, the
construct "]]...[[", etc? What is an alternative for them?
I meant the word `[IF]` by itself, without connection with `WANT`.
Not necessarily a parsing word. Could also be treated as something
like another state (i.e., the text interpreter does the parsing, but
does something different with the words than interpretation state or
compile state. In every case, the interaction with other features is >problematic; e.g., consider:
- anton--
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:53:54 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,093 |