Liste des Groupes | Revenir à cl forth |
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.
\ parses, but apart from interactions like above it looks fine to me.Yes, I mean that in a standard program the only approach available to implement such functionality is the active parsing approach (at the moment).
The word `]]` is also a parsing word (in a standard-compliantYou mean that implementing ]] as a standard program requires parsing.
implementation).
That's true, but the usual implementation in systems is as another
state-like thing. And you also get interesting interactions if you
combine it with [if], or parsing words like \ or (. The sequences
inside ]]...[[ are short enough that this is rarely necessary, and if
it is, you can do, e.g.
]] bla [[ ( x y ) ]] blub [[
instead of
]] bla ( x y ) blub [[
Not great, but has not been a significant issue yet.
How to implement such functionality without active parsing the input stream?How does :NONAME or ] implement its functionality? Do you also
consider it a parsing word? Note that in some Forth, Inc. Forth
systems ] parses on its own rather than using a state of the ordinary
text interpreter.
I would define interpretation semantics for `[']` to be the same as for `'`, as follows:But if such long parsing words like `[IF]` and `]]` are acceptable, whyA problem with parsing words like ' and ['] is that code using them
the words that parses a single lexeme are not acceptable? (apart from
naming and terminator visibility problems)?
usually cannot be copied and pasted between interpreted and compiled
code.
A problem with parsing words like S" is that implementing themIt does not require mechanisms beyond the Forth-2012.
properly requires mechanisms beyond what has been traditionally
available.
Les messages affichés proviennent d'usenet.