Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Imitation is the sincerest form of plagiarism.


devel / comp.lang.forth / Re: Naming for parsing words

SubjectAuthor
* Naming for parsing wordsRuvim
+* Re: Naming for parsing wordsS Jack
|`* Re: Naming for parsing wordsRuvim
| +* Re: Naming for parsing wordsAnton Ertl
| |+* Re: Naming for parsing wordsHans Bezemer
| ||`* Simplicity and the text interpreter (was: Naming for parsing words)Anton Ertl
| || `* Re: Simplicity and the text interpreter (was: Naming for parsing words)Hans Bezemer
| ||  `* Re: Simplicity and the text interpreter (was: Naming for parsing words)Anton Ertl
| ||   `* Re: Simplicity and the text interpreter (was: Naming for parsing words)Hans Bezemer
| ||    `* Re: Simplicity and the text interpreter (was: Naming for parsing words)Anton Ertl
| ||     +- Re: Simplicity and the text interpreter (was: Naming for parsing words)Hans Bezemer
| ||     `* Re: Simplicity and the text interpreterPaul Rubin
| ||      `- Re: Simplicity and the text interpreterHans Bezemer
| |+* Format to quoting a word (was: Naming for parsing words)Ruvim
| ||+* Re: Format to quoting a word (was: Naming for parsing words)Anton Ertl
| |||+* Re: Format to quoting a word (was: Naming for parsing words)Marcel Hendrix
| ||||+- Re: Format to quoting a word (was: Naming for parsing words)Anton Ertl
| ||||`* Re: Format to quoting a word (was: Naming for parsing words)none
| |||| `- Re: Format to quoting a word (was: Naming for parsing words)Anton Ertl
| |||`* Recognizers precedence (was: Format to quoting a word)Ruvim
| ||| +* Re: Recognizers precedence (was: Format to quoting a word)none
| ||| |`- Re: Recognizers precedence (was: Format to quoting a word)dxforth
| ||| `- Re: Recognizers precedence (was: Format to quoting a word)Ruvim
| ||`- Re: Format to quoting a word (was: Naming for parsing words)none
| |+- Re: Naming for parsing wordsRuvim
| |`* Re: Naming for parsing wordsRuvim
| | `* Re: Naming for parsing wordsnone
| |  `* Re: Naming for parsing wordsdxforth
| |   +* Re: Naming for parsing wordsHans Bezemer
| |   |`* Re: Naming for parsing wordsRuvim
| |   | `* Re: Naming for parsing wordsHans Bezemer
| |   |  `* Re: Naming for parsing wordsRuvim
| |   |   +* Re: Naming for parsing wordsdxforth
| |   |   |`* Re: Naming for parsing wordsRuvim
| |   |   | +- Re: Naming for parsing wordsdxforth
| |   |   | `* Re: Naming for parsing wordsS Jack
| |   |   |  `* Re: Naming for parsing wordsminf...@arcor.de
| |   |   |   `* Re: Naming for parsing wordsS Jack
| |   |   |    `* Re: Naming for parsing wordsS Jack
| |   |   |     `- Re: Naming for parsing wordsS Jack
| |   |   +- Re: Naming for parsing wordsnone
| |   |   `- Re: Naming for parsing wordsHans Bezemer
| |   `* Re: Naming for parsing wordsRuvim
| |    `* Re: Naming for parsing wordsRuvim
| |     `- Re: Naming for parsing wordsnone
| +* Re: Naming for parsing wordsS Jack
| |`* Re: Naming for parsing wordsRuvim
| | +- Re: Naming for parsing wordsS Jack
| | `- Re: Naming for parsing wordsnone
| +* Re: Naming for parsing wordsdxforth
| |`* Re: Naming for parsing wordsRuvim
| | `* Re: Naming for parsing wordsP Falth
| |  `* Re: Naming for parsing wordsRuvim
| |   +* Re: Naming for parsing wordsHans Bezemer
| |   |`* Re: Naming for parsing wordsStephen Pelc
| |   | `- Re: Naming for parsing wordsMarcel Hendrix
| |   `* Re: Naming for parsing wordsP Falth
| |    `* Re: Naming for parsing wordsRuvim
| |     `* Re: Naming for parsing wordsP Falth
| |      +* Re: Naming for parsing wordsRuvim
| |      |+* Re: Naming for parsing wordsAnton Ertl
| |      ||+- Re: Naming for parsing wordsminf...@arcor.de
| |      ||`- Re: Naming for parsing wordsRuvim
| |      |`* Re: Naming for parsing wordsStephen Pelc
| |      | `* Re: Naming for parsing wordsS Jack
| |      |  +* Re: Naming for parsing wordsS Jack
| |      |  |`* Re: Naming for parsing wordsStephen Pelc
| |      |  | `- Re: Naming for parsing wordsAnton Ertl
| |      |  +* Re: Naming for parsing wordsRuvim
| |      |  |+* Re: Naming for parsing wordsHans Bezemer
| |      |  ||+* Re: Naming for parsing wordsdxforth
| |      |  |||`* Re: Naming for parsing wordsHans Bezemer
| |      |  ||| `- Re: Naming for parsing wordsdxforth
| |      |  ||`- Re: Naming for parsing wordsnone
| |      |  |`- Re: Naming for parsing wordsS Jack
| |      |  `- Re: Naming for parsing wordsStephen Pelc
| |      `- Re: Naming for parsing wordsS Jack
| +* Re: Naming for parsing wordsnone
| |`- Re: Naming for parsing wordsRuvim
| `* Re: Naming for parsing wordsHans Bezemer
|  `* Re: Naming for parsing wordsnone
|   +- Re: Naming for parsing wordsAnton Ertl
|   `* Re: Naming for parsing wordsHans Bezemer
|    `* IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|     `* Re: IS vs. DEFER! (was: Naming for parsing words)dxforth
|      `* Re: IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|       `* Re: IS vs. DEFER! (was: Naming for parsing words)dxforth
|        `* Re: IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|         `* Re: IS vs. DEFER! (was: Naming for parsing words)dxforth
|          `* Re: IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|           `* Re: IS vs. DEFER! (was: Naming for parsing words)dxforth
|            `* Re: IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|             +* Re: IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|             |`* Re: IS vs. DEFER! (was: Naming for parsing words)Marcel Hendrix
|             | `* Re: IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|             |  `- memory dependencies (was: IS vs. DEFER! (was: Naming for parsing words))Anton Ertl
|             +* Re: IS vs. DEFER! (was: Naming for parsing words)dxforth
|             |+* Re: IS vs. DEFER! (was: Naming for parsing words)Anton Ertl
|             ||`- Re: IS vs. DEFER! (was: Naming for parsing words)dxforth
|             |`* Re: IS vs. DEFER! (was: Naming for parsing words)Hans Bezemer
|             | `* Re: IS vs. DEFER! (was: Naming for parsing words)dxforth
|             `* Re: IS vs. DEFER! (was: Naming for parsing words)P Falth
+* Re: Naming for parsing wordsnone
+* Re: Naming for parsing wordsdxforth
+- Re: Naming for parsing wordsS Jack
`- Re: Naming for parsing wordsRuvim

Pages:12345
Re: Format to quoting a word (was: Naming for parsing words)

<2022May29.164116@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18098&group=comp.lang.forth#18098

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Format to quoting a word (was: Naming for parsing words)
Date: Sun, 29 May 2022 14:41:16 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 44
Message-ID: <2022May29.164116@mips.complang.tuwien.ac.at>
References: <t60i6r$7m0$1@dont-email.me> <t6t189$k0b$1@dont-email.me> <2022May28.152238@mips.complang.tuwien.ac.at> <445b821c-4ee2-4655-b972-2f0b14d80cc9n@googlegroups.com> <nnd$1c1ecc39$3219c36c@bc641d07cb2f609c>
Injection-Info: reader02.eternal-september.org; posting-host="1ee59fb90fd137ce4f0f0082b533b1c0";
logging-data="15623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yE8X6jlimR3i3VWbn7Jx9"
Cancel-Lock: sha1:TcndfndexKTChIw+ChwjqbzfWT8=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 29 May 2022 14:41 UTC

albert@cherry.(none) (albert) writes:
>Do you still use the recognizer/prefix & ?
>We were there first in 1993/2001 with that prefix.

Gforth has supported 'A in 0.2.1 (1996).

But that's water down the river. 'A' has been standardized.

>I would love to see 0X1A for hex

A number of systems support 0x1a, e.g., Gforth:

0x1a . 26 ok

It's just too annoying to have to replace the "0x" from gdb with "$".

>instead of $1A , freeing
>$HOME for environment variables.

In development Gforth:

require rec-env.fs ok
$HOME type /home/anton ok
$1a . 26 ok

No need for freeing. If you have an environment variable that would
be a valid hex number (my normal environment does not), you could
arrange for REC-ENV to be in front of REC-NUM (and write the hex
number with a leading 0), or write "ABC" getenv.

>That would be a beneficial c-compatibility.

C does not support $HOME, so why would that be any kind of
C-compatibility?

And is there any other criterion for "worst" and "beneficial" than
your personal preference?

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Naming for parsing words

<t706bv$rog$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18099&group=comp.lang.forth#18099

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 02:18:05 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t706bv$rog$1@gioia.aioe.org>
References: <t60i6r$7m0$1@dont-email.me> <t62vui$1mi$1@dont-email.me>
<2022May19.164709@mips.complang.tuwien.ac.at> <t6t9mi$buj$2@dont-email.me>
<nnd$1d4b97d3$073395e9@8abaa6da72b6b30c>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="28432"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Sun, 29 May 2022 16:18 UTC

On 29/05/2022 17:56, albert wrote:
> In article <t6t9mi$buj$2@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:
>>On 2022-05-19 18:47, Anton Ertl wrote:
>>>> And after that, what to do with "[if]" and "[undefined]"?
>>>
>>> And \ and (.
>>
>>If they are with us in any case, we should not avoid them, but properly
>>(safely and readable) use them.
>
> I hate [UNDEFINED].
>
> "socket-server" [UNDEFINED] [IF]
> \ You really mean you can insert a portable definition of `socket-server?
> \ Even if you succeed, you uglifies you code beyond redemption.
> [THEN]
>
> has to be replaced by
>
> WANT socket-server

I don't care for its length but at least [UNDEFINED] is unambiguous.
Were shortness paramount I'd have chosen LACK. But hey, we need to
keep Forth respectable and starched shirts sell better.

Re: Naming for parsing words

<796382cb-51a2-49d4-8c12-913faede4cb3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18100&group=comp.lang.forth#18100

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:13:b0:301:6d0d:c731 with SMTP id x19-20020a05622a001300b003016d0dc731mr4603630qtw.43.1653843228114;
Sun, 29 May 2022 09:53:48 -0700 (PDT)
X-Received: by 2002:a05:6214:1bcf:b0:464:4d4d:9778 with SMTP id
m15-20020a0562141bcf00b004644d4d9778mr1850805qvc.94.1653843227967; Sun, 29
May 2022 09:53:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 29 May 2022 09:53:47 -0700 (PDT)
In-Reply-To: <t706bv$rog$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <t60i6r$7m0$1@dont-email.me> <t62vui$1mi$1@dont-email.me>
<2022May19.164709@mips.complang.tuwien.ac.at> <t6t9mi$buj$2@dont-email.me>
<nnd$1d4b97d3$073395e9@8abaa6da72b6b30c> <t706bv$rog$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <796382cb-51a2-49d4-8c12-913faede4cb3n@googlegroups.com>
Subject: Re: Naming for parsing words
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Sun, 29 May 2022 16:53:48 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1937
 by: Hans Bezemer - Sun, 29 May 2022 16:53 UTC

On Sunday, May 29, 2022 at 6:18:12 PM UTC+2, dxforth wrote:
> > I hate [UNDEFINED].
> I don't care for its length but at least [UNDEFINED] is unambiguous.
> Were shortness paramount I'd have chosen LACK. But hey, we need to
> keep Forth respectable and starched shirts sell better.

I love [UNDEFINED] for the same reason I like

VARIABLE x
VALUE y
CONSTANT z
: a
CHAR b

You parse the thing, look it up in the symboltable and leave a 1 or a 0 - which [IF]
can pick up easily. Ok, you can discuss the name as far as I'm concerned, but that's
it.

I'd hate to see:

S" x" VARIABLE
20 S" y" VALUE
10 S" x" CONSTANT
S" a" DEF{ }
S" b" CHAR

Hans Bezemer

Re: Naming for parsing words

<t70dnb$to4$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18101&group=comp.lang.forth#18101

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Sun, 29 May 2022 22:23:39 +0400
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <t70dnb$to4$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me> <t62vui$1mi$1@dont-email.me>
<2022May19.164709@mips.complang.tuwien.ac.at> <t6t9mi$buj$2@dont-email.me>
<nnd$1d4b97d3$073395e9@8abaa6da72b6b30c> <t706bv$rog$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 18:23:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ace193fe84bf9c01dd765a7b3da3e51b";
logging-data="30468"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/u1e/wbE9z905lR/+iuHXO"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:/Pm4hjwNEPLzoeC9msA8z5r66RM=
In-Reply-To: <t706bv$rog$1@gioia.aioe.org>
Content-Language: en-US
 by: Ruvim - Sun, 29 May 2022 18:23 UTC

On 2022-05-29 20:18, dxforth wrote:
> On 29/05/2022 17:56, albert wrote:
>> In article <t6t9mi$buj$2@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:
>>> On 2022-05-19 18:47, Anton Ertl wrote:
>>>>> And after that, what to do with "[if]" and "[undefined]"?
>>>>
>>>> And \ and (.
>>>
>>> If they are with us in any case, we should not avoid them, but properly
>>> (safely and readable) use them.

By "they" I don't mean these particular words, but porcelain words that
do parsing in general.

>>
>> I hate [UNDEFINED].
>>
>> "socket-server" [UNDEFINED] [IF]
>> \ You really mean you can insert a portable definition of `socket-server?
>> \ Even if you succeed, you uglifies you code beyond redemption.
>> [THEN]
>>
>> has to be replaced by
>>
>> WANT socket-server
>
> I don't care for its length but at least [UNDEFINED] is unambiguous.
> Were shortness paramount I'd have chosen LACK. But hey, we need to
> keep Forth respectable and starched shirts sell better.

lack( foo ) [if]
...
[then]

Nice!

Concerning compilation state, [lack]( foo ) looks overloaded.
So just use [ lack( foo ) ]

: bar
...
[ lack( foo ) ] [if]
...
[then]

[ glut( baz ) ] [if] \ "baz" is available
... baz
[then]
...
;

And to check availability of "foo" at run-time:

: foobar lack( foo ) if ... else ... then ;

--
Ruvim

Re: Naming for parsing words

<t70e47$905$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18102&group=comp.lang.forth#18102

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Sun, 29 May 2022 22:30:29 +0400
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <t70e47$905$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me> <t62vui$1mi$1@dont-email.me>
<2022May19.164709@mips.complang.tuwien.ac.at> <t6t9mi$buj$2@dont-email.me>
<nnd$1d4b97d3$073395e9@8abaa6da72b6b30c> <t706bv$rog$1@gioia.aioe.org>
<796382cb-51a2-49d4-8c12-913faede4cb3n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 18:30:31 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ace193fe84bf9c01dd765a7b3da3e51b";
logging-data="9221"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18d19AcQ9nax058k0F5ZeJD"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:hJUeSaffemtO/gQoQlIN2Dzvx1E=
In-Reply-To: <796382cb-51a2-49d4-8c12-913faede4cb3n@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Sun, 29 May 2022 18:30 UTC

On 2022-05-29 20:53, Hans Bezemer wrote:
> On Sunday, May 29, 2022 at 6:18:12 PM UTC+2, dxforth wrote:
>>> I hate [UNDEFINED].
>> I don't care for its length but at least [UNDEFINED] is unambiguous.
>> Were shortness paramount I'd have chosen LACK. But hey, we need to
>> keep Forth respectable and starched shirts sell better.
>
> I love [UNDEFINED] for the same reason I like
>
> VARIABLE x
> VALUE y
> CONSTANT z
> : a
> CHAR b
>
> You parse the thing, look it up in the symboltable and leave a 1 or a 0 - which [IF]
> can pick up easily. Ok, you can discuss the name as far as I'm concerned, but that's
> it.
>
> I'd hate to see:
>
> S" x" VARIABLE
> 20 S" y" VALUE
> 10 S" x" CONSTANT
> S" a" DEF{ }
> S" b" CHAR

But having shorter string literals it looks better:
"x" var
or
`x var
10 `x const

Anyway, what can you suggest if I need to create a definition (e.g. a
constant) programmatically, and its name is passed as an argument?

Having "const" from the above it could look as:

: foo ( sd.name -- ) ... 10 -rot const ... ;

--
Ruvim

Re: Naming for parsing words

<t70h7u$5jc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18103&group=comp.lang.forth#18103

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Sun, 29 May 2022 23:23:41 +0400
Organization: A noiseless patient Spider
Lines: 92
Message-ID: <t70h7u$5jc$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me>
<27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com>
<t62vui$1mi$1@dont-email.me> <t67838$12n4$1@gioia.aioe.org>
<t6tjc9$j04$1@dont-email.me>
<793ec47d-7352-4f7b-b8e9-0af07522e969n@googlegroups.com>
<t6u3vf$crb$1@dont-email.me>
<95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 May 2022 19:23:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ace193fe84bf9c01dd765a7b3da3e51b";
logging-data="5740"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hT2cth+1rI1+54FbJXUt6"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:/i1BA5zBk225LeL70NwWmAr00GI=
In-Reply-To: <95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Sun, 29 May 2022 19:23 UTC

On 2022-05-29 12:57, P Falth wrote:
> On Saturday, 28 May 2022 at 23:25:06 UTC+2, Ruvim wrote:
>> On 2022-05-29 00:34, P Falth wrote:
>>> On Saturday, 28 May 2022 at 18:41:48 UTC+2, Ruvim wrote:
>>>> On 2022-05-20 09:14, dxforth wrote:
>>
>>>>> A few may enjoy creating
>>>>> new parsing words (like the few that enjoy creating macros) but I wouldn't
>>>>> say either was intrinsic to Forth, or even popular. If creating new parsing
>>>>> words were popular, wouldn't there already be a convention for it?
>>>>>
>>>>> https://pastebin.com/qpZLFc6h
>>>>
>>>> The old convention was: don't use any special naming convention for
>>>> porcelain parsing word, they should look just like ordinary words.
>>>>
>>>> For example: "[COMPILE]" and ASCII in Forth-79, POSTPONE in Forth-94
>>>
>>> One of the first things that struck me when I learned about the forth language
>>> was the complete freedom to name words whatever you wanted.
>>> I do not want to change that!
>>> What you have presented might be very logical but it looks ugly and does not
>>> read well.
>> OK. Could you please order by ugliness (from higher to lower) the
>> following definitions for the word "ip-in-subnet ( x.ip x.ip-mask
>> x.ip-net -- flag )":
>
> This is how I would write it
>> : ip-in-subnet >r and r> = ;

This example is taken for simplicity. Instead, just take your real life
case when you pass an xt as an argument, or pass a word (or several) as
an immediate argument.

> This I can understand after looking up what dip does
>> : ip-in-subnet ['] and dip = ;
>
> The rest are just ugly and difficult to read. ' ´ ` all look the same for me at a quick view
>> : ip-in-subnet 'and dip = ; \ Tick is for quoting a word
>> : ip-in-subnet `and dip = ; \ Backtick is for quoting a word
>> : ip-in-subnet dip' and = ;
>> : ip-in-subnet dip:and = ;
>> : ip-in-subnet dip( and ) = ;
>> : ip-in-subnet dip{ and } = ;
>
> What I do not understand is this drive to pass an XT as argument.

No any xt is passed in the last four code examples.

> For sure it can be powerful in certain cases,
> but you do not need to rewrite everything in that style.

Actually, it's my position too.

Have a look [1], I started from a combinator (a word that accepts an xt
on the stack), and then introduced an equivalent parsing word:

| Now let's consider a variant of the "dip" combinator
| that accepts a word to be executed as an immediate argument
| and generates a more efficient code. Also, this variant can
| be better readable when the word is known in advance.

I provided two reasons for that:

1. Potentially, more efficient code.
2. Potentially, better readability.

In general, I talk not only about passing xt, but passing any argument
(for example, a name string).

Accepting immediate arguments can be a good choice in many cases. But a
common problem that authors don't mark these arguments in the source
code explicitly. And that worsens readability.

So for the words having immediate arguments — I want the boundaries of
these arguments be easy visible. And in the same time I want to have the
corresponding ("plumbing") words that accepts argument from the data
stack (or, reluctantly, a technique like "execute-parsing" at least).

[1] https://github.com/ForthHub/discussion/discussions/112

--
Ruvim

Re: Naming for parsing words

<db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18104&group=comp.lang.forth#18104

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:60e:b0:303:9aca:e9fc with SMTP id z14-20020a05622a060e00b003039acae9fcmr2270131qta.657.1653856151479;
Sun, 29 May 2022 13:29:11 -0700 (PDT)
X-Received: by 2002:a05:6214:411c:b0:45a:d240:afb9 with SMTP id
kc28-20020a056214411c00b0045ad240afb9mr43072820qvb.122.1653856151220; Sun, 29
May 2022 13:29:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 29 May 2022 13:29:11 -0700 (PDT)
In-Reply-To: <t70h7u$5jc$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=80.182.235.230; posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 80.182.235.230
References: <t60i6r$7m0$1@dont-email.me> <27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com>
<t62vui$1mi$1@dont-email.me> <t67838$12n4$1@gioia.aioe.org>
<t6tjc9$j04$1@dont-email.me> <793ec47d-7352-4f7b-b8e9-0af07522e969n@googlegroups.com>
<t6u3vf$crb$1@dont-email.me> <95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com>
<t70h7u$5jc$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
Subject: Re: Naming for parsing words
From: peter.m....@gmail.com (P Falth)
Injection-Date: Sun, 29 May 2022 20:29:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: P Falth - Sun, 29 May 2022 20:29 UTC

On Sunday, 29 May 2022 at 21:23:44 UTC+2, Ruvim wrote:
> On 2022-05-29 12:57, P Falth wrote:
> > On Saturday, 28 May 2022 at 23:25:06 UTC+2, Ruvim wrote:
> >> On 2022-05-29 00:34, P Falth wrote:
> >>> On Saturday, 28 May 2022 at 18:41:48 UTC+2, Ruvim wrote:
> >>>> On 2022-05-20 09:14, dxforth wrote:
> >>
> >>>>> A few may enjoy creating
> >>>>> new parsing words (like the few that enjoy creating macros) but I wouldn't
> >>>>> say either was intrinsic to Forth, or even popular. If creating new parsing
> >>>>> words were popular, wouldn't there already be a convention for it?
> >>>>>
> >>>>> https://pastebin.com/qpZLFc6h
> >>>>
> >>>> The old convention was: don't use any special naming convention for
> >>>> porcelain parsing word, they should look just like ordinary words.
> >>>>
> >>>> For example: "[COMPILE]" and ASCII in Forth-79, POSTPONE in Forth-94
> >>>
> >>> One of the first things that struck me when I learned about the forth language
> >>> was the complete freedom to name words whatever you wanted.
> >>> I do not want to change that!
> >>> What you have presented might be very logical but it looks ugly and does not
> >>> read well.
> >> OK. Could you please order by ugliness (from higher to lower) the
> >> following definitions for the word "ip-in-subnet ( x.ip x.ip-mask
> >> x.ip-net -- flag )":
> >
> > This is how I would write it
> >> : ip-in-subnet >r and r> = ;
> This example is taken for simplicity. Instead, just take your real life
> case when you pass an xt as an argument, or pass a word (or several) as
> an immediate argument.
> > This I can understand after looking up what dip does
> >> : ip-in-subnet ['] and dip = ;
> >
> > The rest are just ugly and difficult to read. ' ´ ` all look the same for me at a quick view
> >> : ip-in-subnet 'and dip = ; \ Tick is for quoting a word
> >> : ip-in-subnet `and dip = ; \ Backtick is for quoting a word
> >> : ip-in-subnet dip' and = ;
> >> : ip-in-subnet dip:and = ;
> >> : ip-in-subnet dip( and ) = ;
> >> : ip-in-subnet dip{ and } = ;
> >
> > What I do not understand is this drive to pass an XT as argument.
> No any xt is passed in the last four code examples.
> > For sure it can be powerful in certain cases,
> > but you do not need to rewrite everything in that style.
> Actually, it's my position too.
>
> Have a look [1], I started from a combinator (a word that accepts an xt
> on the stack), and then introduced an equivalent parsing word:
>
> | Now let's consider a variant of the "dip" combinator
> | that accepts a word to be executed as an immediate argument
> | and generates a more efficient code. Also, this variant can
> | be better readable when the word is known in advance.
>
> I provided two reasons for that:
>
> 1. Potentially, more efficient code.
> 2. Potentially, better readability.
>
>
> In general, I talk not only about passing xt, but passing any argument
> (for example, a name string).
>
> Accepting immediate arguments can be a good choice in many cases. But a
> common problem that authors don't mark these arguments in the source
> code explicitly. And that worsens readability.
>
>
> So for the words having immediate arguments — I want the boundaries of
> these arguments be easy visible. And in the same time I want to have the
> corresponding ("plumbing") words that accepts argument from the data
> stack (or, reluctantly, a technique like "execute-parsing" at least).

To make them visible I have a completely different solution.
I have written a context sensitive Forth colorizer for the text editor I am using (SciTe)

After I add parsing words to the right section they will color their arguments different
then ordinary text. It is a great help for readability.

Peter
>
> [1] https://github.com/ForthHub/discussion/discussions/112
>
>
> --
> Ruvim

Re: Naming for parsing words

<t70m6s$cbt$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18105&group=comp.lang.forth#18105

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 00:48:26 +0400
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <t70m6s$cbt$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me>
<nnd$587ee73c$4c21fe45@037f106620cc2af5> <t6tldc$2k1$1@dont-email.me>
<nnd$3d10df8b$6bb7895d@e6ed3ef9eff9674c>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 May 2022 20:48:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ace193fe84bf9c01dd765a7b3da3e51b";
logging-data="12669"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ExoZ1fIh4kfq9MmJqZMwC"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:jlJ6xWG5ckA3z0vbztir8WbcW4Y=
In-Reply-To: <nnd$3d10df8b$6bb7895d@e6ed3ef9eff9674c>
Content-Language: en-US
 by: Ruvim - Sun, 29 May 2022 20:48 UTC

On 2022-05-29, albert wrote:
> In article <t6tldc$2k1$1@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:

>> And if a porcelain parsing word is allowed to be used in compilation
>> state and in interpretation state, it should accept immediate arguments
>> in both cases (or explicitly show that an argument is passed via the
>> stack instead).
>
> A user of my reverse engineering assembler would use "porcelain"
> words only. These are a layer separated from reality, and can
> be used only via meticulous documentation.
> You are spreading an illusion of git-people, that porcelain words
> are intuitive. That makes git all but unusable for the casual
> user.

I don't imply the idea of intuitiveness at all.

In Git, plumbing commands "to be used as building blocks for new tools
and custom scripts" [1], "these commands are primarily for scripted use"
[2].

Porcelain commands are high-level commands [3]. These commands are
intended for direct use and their output format may be changed (to make
it better readable by humans) by evolving.

Using this terminology, "parse-name" is a plumbing word in Forth. The
word "constant" is a porcelain word (which is intended for direct use).
But we don't have a corresponding plumbing word to create a constant.

[1] Git Internals - Plumbing and Porcelain
https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain

[2] Low-level commands (plumbing)
https://git.github.io/htmldocs/git.html#_low_level_commands_plumbing

[3] High-level commands (porcelain)
https://git.github.io/htmldocs/git.html#_high_level_commands_porcelain

--
Ruvim

Re: Naming for parsing words

<t70nh4$6ia$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18106&group=comp.lang.forth#18106

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 01:10:58 +0400
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <t70nh4$6ia$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me>
<27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com>
<t62vui$1mi$1@dont-email.me> <t67838$12n4$1@gioia.aioe.org>
<t6tjc9$j04$1@dont-email.me>
<793ec47d-7352-4f7b-b8e9-0af07522e969n@googlegroups.com>
<t6u3vf$crb$1@dont-email.me>
<95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com>
<t70h7u$5jc$1@dont-email.me>
<db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 May 2022 21:11:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ace193fe84bf9c01dd765a7b3da3e51b";
logging-data="6730"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18W6tOnu28xiryGYQ0QrSGx"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:aINGsfpfcx5f52dgzOnWpvJMxiY=
In-Reply-To: <db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Sun, 29 May 2022 21:10 UTC

On 2022-05-30, P Falth wrote:
> On Sunday, 29 May 2022 at 21:23:44 UTC+2, Ruvim wrote:
[...]
>> So for the words having immediate arguments — I want the boundaries of
>> these arguments be easy visible. And in the same time I want to have the
>> corresponding ("plumbing") words that accepts argument from the data
>> stack (or, reluctantly, a technique like "execute-parsing" at least).
>
> To make them visible I have a completely different solution.
> I have written a context sensitive Forth colorizer for the text editor I am using (SciTe)
>
> After I add parsing words to the right section they will color their arguments different
> then ordinary text. It is a great help for readability.

I see. Probably, this solution is acceptable for individuals or very
small collectives.

But this solution is not scalable on the whole Forth ecosystem. It is
not suitable for shared code and distributed development.

--
Ruvim

Re: Recognizers precedence (was: Format to quoting a word)

<nnd$27da972f$67465d23@98c6703f655a41c5>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18108&group=comp.lang.forth#18108

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <t60i6r$7m0$1@dont-email.me> <t6t189$k0b$1@dont-email.me> <2022May28.152238@mips.complang.tuwien.ac.at> <t6vvk4$bl7$1@dont-email.me>
Subject: Re: Recognizers precedence (was: Format to quoting a word)
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$27da972f$67465d23@98c6703f655a41c5>
Organization: KPN B.V.
Date: Mon, 30 May 2022 08:28:42 +0200
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!94.232.112.246.MISMATCH!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 63
Injection-Date: Mon, 30 May 2022 08:28:42 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Mon, 30 May 2022 06:28 UTC

In article <t6vvk4$bl7$1@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:
>On 2022-05-28 17:22, Anton Ertl wrote:
>> Ruvim <ruvim.pinka@gmail.com> writes:
>>> On 2022-05-19 18:47, Anton Ertl wrote:
>>>> Instead of ['] FOO, I write `FOO. The latter can be copy-pasted into
>>>> interpretive code.
>>>
>>> To quoting a word I prefer the form 'FOO (i.e. Tick vs Backtick) for the
>>> following reasons:
>>> - it is closer to "[']" and "'" (so it's already connotated with
>>> quoting a word in Forth);
>>> - it is also used for quoting in some other languages (e.g., in Lisp,
>>> to quote a list).
>>>
>>> Possible disadvantage of this choice are as follows.
>>>
>>> - Sometimes Tick is an actual part of a name. But those who use names
>>> starting with a Tick probably will not use recognizers, but parsing words.
>>
>> Gforth currently has the following words starting with ':
>>
>> '-error ' 'quit 'cold 'image 'clean-maintask
>>
>> and Gforth has recognizers. Also, I have seen several programs that
>> define words with names starting with ' (and often paired with a word
>> with a name without ', such as 'QUIT and QUIT). For ` I have yet to
>> see someone write a word that starts with that. As soon as someone
>> loads that program in a system with a '-recognizer, there are the
>> following potential problems:
>>
>> * The user may be unaware of the existence of 'QUIT, and writes 'QUIT
>> with the intention of getting the xt of QUIT, but gets something
>> else because the word-recognizer precedes the '-recognizer.
>>
>> * If, OTOH, the '-recognizer preceded the word-recognizer, you get the
>> converse problem: If you want to get at the word 'QUIT, you get the
>> xt of QUIT instead.
>
>
>As a user, I would prefer the tick-recognizer precedes the
>word-recognizer. Since I know that I always use a leading tick either to
>quoting a word, or for a character literal (when the lexeme ends with a
>tick and consists of 3 xchars), and don't use a tick in names at all.

In ciforth the question is moot. Recognizers (prefixes) are present
in the dictionary in wordlists. Normal precedence rules apply.
If a recognizer is present in a VOCABULARY, you can switch it off
by not adding that vocabulary to the search order.
The exception position for numbers (and other denotations) was a
major design flaw in the original Forth.
Note that Moore himself moved away from that in colorforth.

>
>--
>Ruvim

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Naming for parsing words

<de46d624-d0d0-4b5d-a1fe-e40124718119n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18109&group=comp.lang.forth#18109

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:4e94:0:b0:2fc:7035:3211 with SMTP id 20-20020ac84e94000000b002fc70353211mr15770168qtp.300.1653896491388;
Mon, 30 May 2022 00:41:31 -0700 (PDT)
X-Received: by 2002:a05:620a:17a4:b0:6a3:aa21:50d7 with SMTP id
ay36-20020a05620a17a400b006a3aa2150d7mr23327141qkb.227.1653896491194; Mon, 30
May 2022 00:41:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 30 May 2022 00:41:31 -0700 (PDT)
In-Reply-To: <db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:3400:4473:a593:8d3f;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:3400:4473:a593:8d3f
References: <t60i6r$7m0$1@dont-email.me> <27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com>
<t62vui$1mi$1@dont-email.me> <t67838$12n4$1@gioia.aioe.org>
<t6tjc9$j04$1@dont-email.me> <793ec47d-7352-4f7b-b8e9-0af07522e969n@googlegroups.com>
<t6u3vf$crb$1@dont-email.me> <95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com>
<t70h7u$5jc$1@dont-email.me> <db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <de46d624-d0d0-4b5d-a1fe-e40124718119n@googlegroups.com>
Subject: Re: Naming for parsing words
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Mon, 30 May 2022 07:41:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1963
 by: S Jack - Mon, 30 May 2022 07:41 UTC

On Sunday, May 29, 2022 at 3:29:12 PM UTC-5, P Falth wrote:
> I have written a context sensitive Forth colorizer for the text editor I am using (SciTe)
>

VIM has a color setup for each language including Forth and user can
modify, add to or change color, as needed. My Forth is ever evolving and I
haven't changed the color setting in last 10 years so in effect I have little
reliance on color. But that's just me :)
--
me

Re: Recognizers precedence (was: Format to quoting a word)

<t71tbu$nk7$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18110&group=comp.lang.forth#18110

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Recognizers precedence (was: Format to quoting a word)
Date: Mon, 30 May 2022 17:56:45 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t71tbu$nk7$1@gioia.aioe.org>
References: <t60i6r$7m0$1@dont-email.me> <t6t189$k0b$1@dont-email.me>
<2022May28.152238@mips.complang.tuwien.ac.at> <t6vvk4$bl7$1@dont-email.me>
<nnd$27da972f$67465d23@98c6703f655a41c5>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="24199"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Mon, 30 May 2022 07:56 UTC

On 30/05/2022 16:28, albert wrote:
> In article <t6vvk4$bl7$1@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:
>>On 2022-05-28 17:22, Anton Ertl wrote:
>>> Ruvim <ruvim.pinka@gmail.com> writes:
>>>> On 2022-05-19 18:47, Anton Ertl wrote:
>>>>> Instead of ['] FOO, I write `FOO. The latter can be copy-pasted into
>>>>> interpretive code.
>>>>
>>>> To quoting a word I prefer the form 'FOO (i.e. Tick vs Backtick) for the
>>>> following reasons:
>>>> - it is closer to "[']" and "'" (so it's already connotated with
>>>> quoting a word in Forth);
>>>> - it is also used for quoting in some other languages (e.g., in Lisp,
>>>> to quote a list).
>>>>
>>>> Possible disadvantage of this choice are as follows.
>>>>
>>>> - Sometimes Tick is an actual part of a name. But those who use names
>>>> starting with a Tick probably will not use recognizers, but parsing words.
>>>
>>> Gforth currently has the following words starting with ':
>>>
>>> '-error ' 'quit 'cold 'image 'clean-maintask
>>>
>>> and Gforth has recognizers. Also, I have seen several programs that
>>> define words with names starting with ' (and often paired with a word
>>> with a name without ', such as 'QUIT and QUIT). For ` I have yet to
>>> see someone write a word that starts with that. As soon as someone
>>> loads that program in a system with a '-recognizer, there are the
>>> following potential problems:
>>>
>>> * The user may be unaware of the existence of 'QUIT, and writes 'QUIT
>>> with the intention of getting the xt of QUIT, but gets something
>>> else because the word-recognizer precedes the '-recognizer.
>>>
>>> * If, OTOH, the '-recognizer preceded the word-recognizer, you get the
>>> converse problem: If you want to get at the word 'QUIT, you get the
>>> xt of QUIT instead.
>>
>>
>>As a user, I would prefer the tick-recognizer precedes the
>>word-recognizer. Since I know that I always use a leading tick either to
>>quoting a word, or for a character literal (when the lexeme ends with a
>>tick and consists of 3 xchars), and don't use a tick in names at all.
>
> In ciforth the question is moot. Recognizers (prefixes) are present
> in the dictionary in wordlists. Normal precedence rules apply.
> If a recognizer is present in a VOCABULARY, you can switch it off
> by not adding that vocabulary to the search order.
> The exception position for numbers (and other denotations) was a
> major design flaw in the original Forth.
> Note that Moore himself moved away from that in colorforth.

There's not much Moore hasn't move away from. Having left Forth Inc
there was nothing to hold him back. Whenever he announced a new forth
there'd be a flurry of interest only for it to dissipate. For all the
rhetoric, it seems few forthers are willing to venture 'beyond the fields
we know' to borrow Dunsany's phrase. We're ready to accept - provided
Standard Forth approves.

Re: Naming for parsing words

<2022May30.122455@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18111&group=comp.lang.forth#18111

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 10:24:55 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 50
Message-ID: <2022May30.122455@mips.complang.tuwien.ac.at>
References: <t60i6r$7m0$1@dont-email.me> <27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com> <t62vui$1mi$1@dont-email.me> <t67838$12n4$1@gioia.aioe.org> <t6tjc9$j04$1@dont-email.me> <793ec47d-7352-4f7b-b8e9-0af07522e969n@googlegroups.com> <t6u3vf$crb$1@dont-email.me> <95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com> <t70h7u$5jc$1@dont-email.me> <db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com> <t70nh4$6ia$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="d9fd092cc2655821476c08c28a1675ed";
logging-data="14432"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kMjnJahEQNyQzomfs4PdB"
Cancel-Lock: sha1:vTQQHA7zMwMrhNy/qtBf9FbQUHA=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Mon, 30 May 2022 10:24 UTC

Ruvim <ruvim.pinka@gmail.com> writes:
>On 2022-05-30, P Falth wrote:
>> On Sunday, 29 May 2022 at 21:23:44 UTC+2, Ruvim wrote:
>[...]
>>> So for the words having immediate arguments — I want the boundaries of
>>> these arguments be easy visible. And in the same time I want to have the
>>> corresponding ("plumbing") words that accepts argument from the data
>>> stack (or, reluctantly, a technique like "execute-parsing" at least).
>>
>> To make them visible I have a completely different solution.
>> I have written a context sensitive Forth colorizer for the text editor I am using (SciTe)
>>
>> After I add parsing words to the right section they will color their arguments different
>> then ordinary text. It is a great help for readability.
>
>
>I see. Probably, this solution is acceptable for individuals or very
>small collectives.
>
>But this solution is not scalable on the whole Forth ecosystem. It is
>not suitable for shared code and distributed development.

Why not?

Sure, you may need to add the parsing words to multiple editors, but
that's doable. And you don't add that many parsing words.

I guess that with the language server protocol you can add the parsing
words to several editors at once.

Of course, with a naming convention you would just add the convention
to the editor, no need to add every word separately, so a large
project might want to introduce such a convention.

One very general way would be to load the project into a Forth system,
and use the system's parsing and recognizing for coloring: If a piece
of source code is parsed with with something other than the text
interpreter's PARSE-NAME or one of a list of pre-defined parsing words
(e.g., S", (, \), you give the parsing-word-parsed colour to the piece
of source code. You colour stuff parsed by the text interpreter based
on the recognizer that recognizes it, and stuff parsed by S", (, \,
and maybe a few others separately. You have to find some way to
continue parsing after an error to make this approach usable.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Naming for parsing words

<6806b73a-15cb-4410-8b9f-c01187f4a087n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18112&group=comp.lang.forth#18112

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5f4c:0:b0:301:4cd2:7ddd with SMTP id y12-20020ac85f4c000000b003014cd27dddmr7289712qta.187.1653913580802;
Mon, 30 May 2022 05:26:20 -0700 (PDT)
X-Received: by 2002:a05:620a:4308:b0:6a5:f603:c494 with SMTP id
u8-20020a05620a430800b006a5f603c494mr9017886qko.742.1653913580647; Mon, 30
May 2022 05:26:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 30 May 2022 05:26:20 -0700 (PDT)
In-Reply-To: <2022May30.122455@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f29:3a24:810e:e8c4:681d:15bf;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f29:3a24:810e:e8c4:681d:15bf
References: <t60i6r$7m0$1@dont-email.me> <27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com>
<t62vui$1mi$1@dont-email.me> <t67838$12n4$1@gioia.aioe.org>
<t6tjc9$j04$1@dont-email.me> <793ec47d-7352-4f7b-b8e9-0af07522e969n@googlegroups.com>
<t6u3vf$crb$1@dont-email.me> <95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com>
<t70h7u$5jc$1@dont-email.me> <db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
<t70nh4$6ia$1@dont-email.me> <2022May30.122455@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6806b73a-15cb-4410-8b9f-c01187f4a087n@googlegroups.com>
Subject: Re: Naming for parsing words
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Mon, 30 May 2022 12:26:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4198
 by: minf...@arcor.de - Mon, 30 May 2022 12:26 UTC

Anton Ertl schrieb am Montag, 30. Mai 2022 um 13:02:59 UTC+2:
> Ruvim <ruvim...@gmail.com> writes:
> >On 2022-05-30, P Falth wrote:
> >> On Sunday, 29 May 2022 at 21:23:44 UTC+2, Ruvim wrote:
> >[...]
> >>> So for the words having immediate arguments — I want the boundaries of
> >>> these arguments be easy visible. And in the same time I want to have the
> >>> corresponding ("plumbing") words that accepts argument from the data
> >>> stack (or, reluctantly, a technique like "execute-parsing" at least).
> >>
> >> To make them visible I have a completely different solution.
> >> I have written a context sensitive Forth colorizer for the text editor I am using (SciTe)
> >>
> >> After I add parsing words to the right section they will color their arguments different
> >> then ordinary text. It is a great help for readability.
> >
> >
> >I see. Probably, this solution is acceptable for individuals or very
> >small collectives.
> >
> >But this solution is not scalable on the whole Forth ecosystem. It is
> >not suitable for shared code and distributed development.
> Why not?
>
> Sure, you may need to add the parsing words to multiple editors, but
> that's doable. And you don't add that many parsing words.
>
> I guess that with the language server protocol you can add the parsing
> words to several editors at once.
>
> Of course, with a naming convention you would just add the convention
> to the editor, no need to add every word separately, so a large
> project might want to introduce such a convention.
>
> One very general way would be to load the project into a Forth system,
> and use the system's parsing and recognizing for coloring: If a piece
> of source code is parsed with with something other than the text
> interpreter's PARSE-NAME or one of a list of pre-defined parsing words
> (e.g., S", (, \), you give the parsing-word-parsed colour to the piece
> of source code. You colour stuff parsed by the text interpreter based
> on the recognizer that recognizes it, and stuff parsed by S", (, \,
> and maybe a few others separately. You have to find some way to
> continue parsing after an error to make this approach usable.
> - anton
> --

Aargh... non-immediate state-dependent parsing words,
camouflaged as recognizers, back-ticked for short-hand notation,
colorized with respect to daltonians, are certainly Forth's future.

Re: Naming for parsing words

<t72hmb$ija$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18113&group=comp.lang.forth#18113

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 17:43:36 +0400
Organization: A noiseless patient Spider
Lines: 92
Message-ID: <t72hmb$ija$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me>
<27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com>
<t62vui$1mi$1@dont-email.me> <t67838$12n4$1@gioia.aioe.org>
<t6tjc9$j04$1@dont-email.me>
<793ec47d-7352-4f7b-b8e9-0af07522e969n@googlegroups.com>
<t6u3vf$crb$1@dont-email.me>
<95092c8c-d6f2-42af-acf6-8a10738123dfn@googlegroups.com>
<t70h7u$5jc$1@dont-email.me>
<db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
<t70nh4$6ia$1@dont-email.me> <2022May30.122455@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 May 2022 13:43:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="409de6c4fc5ecdab5af95a3984c77c61";
logging-data="19050"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RhxHyKT4VIPjCDDQO4xIS"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:MVGj8EOrXFicgwTQljMnFTFetps=
In-Reply-To: <2022May30.122455@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Ruvim - Mon, 30 May 2022 13:43 UTC

On 2022-05-30 14:24, Anton Ertl wrote:
> Ruvim <ruvim.pinka@gmail.com> writes:
>> On 2022-05-30, P Falth wrote:
>>> On Sunday, 29 May 2022 at 21:23:44 UTC+2, Ruvim wrote:
>> [...]
>>>> So for the words having immediate arguments — I want the boundaries of
>>>> these arguments be easy visible. And in the same time I want to have the
>>>> corresponding ("plumbing") words that accepts argument from the data
>>>> stack (or, reluctantly, a technique like "execute-parsing" at least).
>>>
>>> To make them visible I have a completely different solution.
>>> I have written a context sensitive Forth colorizer for the text editor I am using (SciTe)
>>>
>>> After I add parsing words to the right section they will color their arguments different
>>> then ordinary text. It is a great help for readability.
>>
>>
>> I see. Probably, this solution is acceptable for individuals or very
>> small collectives.
>>
>> But this solution is not scalable on the whole Forth ecosystem. It is
>> not suitable for shared code and distributed development.
>
> Why not?
>
> Sure, you may need to add the parsing words to multiple editors, but
> that's doable. And you don't add that many parsing words.

1. Parsing words of one project can conflict with parsing words of other
project.

Do you really think that every "dip_ x" can be globally reserved as a
parsing word? (taking into account that naming convention is not used,
and parsing words are named as other ordinary words).

2. This solution forces to use only editors that can highlight text by
known protocol. But some people don't use highlighting at all.

> I guess that with the language server protocol you can add the parsing
> words to several editors at once.
>
> Of course, with a naming convention you would just add the convention
> to the editor, no need to add every word separately, so a large
> project might want to introduce such a convention.

Yes. And a system of reusable Forth packages (that I keep in mind) is a
large project in this sense.

> One very general way would be to load the project into a Forth system,
> and use the system's parsing and recognizing for coloring: If a piece
> of source code is parsed with with something other than the text
> interpreter's PARSE-NAME or one of a list of pre-defined parsing words
> (e.g., S", (, \), you give the parsing-word-parsed colour to the piece
> of source code. You colour stuff parsed by the text interpreter based
> on the recognizer that recognizes it, and stuff parsed by S", (, \,
> and maybe a few others separately. You have to find some way to
> continue parsing after an error to make this approach usable.

I used this approach for correct programs that are loaded into the Forth
system. I changed the Forth text interpreter in such a way that it
generates XML during translation of source code.

After that I generated XHTML (from XML) with code highlighting
(including parsed parts or immediate arguments, immediate words,
numbers, etc), links to other files (that were subjects of INCLUDED),
cross-references (i.e., places where a word is used), and links to the
definition for each word.

I didn't need to specially handle standard words like S", (, \, etc.

All text that was read from the input stream during translation of a
word was considered as an immediate argument of this word.

Concerning errors. I think, continue loading after an error could be
dangerous, and it makes a little sense due to more and more incorrect
highlighting, since an error in compilation of one word (especially a
defining word) produces errors in compilation dependent words like an
avalanche, recursively.

I can also imagine this approach in a Forth live coding system,
conceptually something like Holon, but with less restriction on the
source code structure, and having robust mapping to the text files of
source code.

--
Ruvim

Re: Recognizers precedence (was: Format to quoting a word)

<t72k23$507$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18114&group=comp.lang.forth#18114

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Recognizers precedence (was: Format to quoting a word)
Date: Mon, 30 May 2022 18:23:57 +0400
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <t72k23$507$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me>
<27ad099d-5b39-4e07-9fc6-7afa4a5556aen@googlegroups.com>
<t62vui$1mi$1@dont-email.me> <2022May19.164709@mips.complang.tuwien.ac.at>
<t6t189$k0b$1@dont-email.me> <2022May28.152238@mips.complang.tuwien.ac.at>
<t6vvk4$bl7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 May 2022 14:24:03 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="409de6c4fc5ecdab5af95a3984c77c61";
logging-data="5127"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hecmcAOkTV4LGhw8WUflL"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:VTR/bBaO8lVf9au/DmhxmmXRk94=
In-Reply-To: <t6vvk4$bl7$1@dont-email.me>
Content-Language: en-US
 by: Ruvim - Mon, 30 May 2022 14:23 UTC

On 2022-05-29 18:22, Ruvim wrote:
> On 2022-05-28 17:22, Anton Ertl wrote:
[...]

>> I just hope that, like I do for field words, you will use the
>> (hopefully standardized) string syntax "string" (which already has a
>> lot of mindshare), and that we reach a consensus for a syntax for xt
>> literals, and all use that then.

For all: if you use additional recognizers (beyond words and numbers),
then what recognizers do you prefer to be in the sequence that a
standard system should provide by a request? (I mean, not initially, but
after asking only).

>
>   forth-2023 !perception{
>
>     ... \ code that uses a standard set of recognizers
>     ... \ including 'FOO   `name  wordlist1::wordlist2::name etc
>     ... \ that precede the word-recognizer  (!)
>   }
>
> or
>
>   forth-2023 !perception//   \ up to the end of file
>
>
> (the naming is under construction)

--
Ruvim

Re: Naming for parsing words

<t72l7e$ds5$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18115&group=comp.lang.forth#18115

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 18:43:54 +0400
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <t72l7e$ds5$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me> <t62vui$1mi$1@dont-email.me>
<2022May19.164709@mips.complang.tuwien.ac.at> <t6t9mi$buj$2@dont-email.me>
<nnd$1d4b97d3$073395e9@8abaa6da72b6b30c> <t706bv$rog$1@gioia.aioe.org>
<t70dnb$to4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 May 2022 14:43:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="409de6c4fc5ecdab5af95a3984c77c61";
logging-data="14213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GqiDtdt9IMBK2ToHa3dCJ"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:0BKZmlWCC2jB1yM6dEK9qn3lTrs=
In-Reply-To: <t70dnb$to4$1@dont-email.me>
Content-Language: en-US
 by: Ruvim - Mon, 30 May 2022 14:43 UTC

On 2022-05-29 22:23, Ruvim wrote:
> On 2022-05-29 20:18, dxforth wrote:

>> I don't care for its length but at least [UNDEFINED] is unambiguous.
>> Were shortness paramount I'd have chosen LACK.  But hey, we need to
>> keep Forth respectable and starched shirts sell better.
>
>
>   lack( foo ) [if]
>      ...
>   [then]
>
> Nice!

Probably, readability of following

"foo" lack [if] ... [then]

is not worser.

--
Ruvim

Re: Naming for parsing words

<t72qgm$qdl$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18116&group=comp.lang.forth#18116

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: step...@vfxforth.com (Stephen Pelc)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 16:14:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <t72qgm$qdl$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me> <t70h7u$5jc$1@dont-email.me> <db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com> <t70nh4$6ia$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 May 2022 16:14:14 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="edda3ada093cb599a5c378d31317be98";
logging-data="27061"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sELFkHSLnkJO8t3mdDzlS"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:1NMLu8mDaFEUb062xi6W5DdCYIE=
X-Usenapp: v1.20/l - Full License
 by: Stephen Pelc - Mon, 30 May 2022 16:14 UTC

On 29 May 2022 at 23:10:58 CEST, "Ruvim" <ruvim.pinka@gmail.com> wrote:

> On 2022-05-30, P Falth wrote:
>> On Sunday, 29 May 2022 at 21:23:44 UTC+2, Ruvim wrote:
> [...]
>>> So for the words having immediate arguments — I want the boundaries of
>>> these arguments be easy visible. And in the same time I want to have the
>>> corresponding ("plumbing") words that accepts argument from the data
>>> stack (or, reluctantly, a technique like "execute-parsing" at least).
>>
>> To make them visible I have a completely different solution.
>> I have written a context sensitive Forth colorizer for the text editor I am
>> using (SciTe)
>>
>> After I add parsing words to the right section they will color their
>> arguments different
>> then ordinary text. It is a great help for readability.
>
> I see. Probably, this solution is acceptable for individuals or very
> small collectives.

Why not large collectives?

> But this solution is not scalable on the whole Forth ecosystem. It is
> not suitable for shared code and distributed development.

Why not? Syntax colouring editors have been around for a long time.

Stephen

--
Stephen Pelc, stephen@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads

Re: Naming for parsing words

<10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18117&group=comp.lang.forth#18117

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:108:b0:2fc:7ed3:a158 with SMTP id u8-20020a05622a010800b002fc7ed3a158mr17761397qtw.597.1653929906774;
Mon, 30 May 2022 09:58:26 -0700 (PDT)
X-Received: by 2002:a05:620a:258f:b0:680:f657:d3d0 with SMTP id
x15-20020a05620a258f00b00680f657d3d0mr39255550qko.707.1653929906588; Mon, 30
May 2022 09:58:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 30 May 2022 09:58:26 -0700 (PDT)
In-Reply-To: <t72qgm$qdl$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:3400:4473:a593:8d3f;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:3400:4473:a593:8d3f
References: <t60i6r$7m0$1@dont-email.me> <t70h7u$5jc$1@dont-email.me>
<db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com> <t70nh4$6ia$1@dont-email.me>
<t72qgm$qdl$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com>
Subject: Re: Naming for parsing words
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Mon, 30 May 2022 16:58:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2284
 by: S Jack - Mon, 30 May 2022 16:58 UTC

On Monday, May 30, 2022 at 11:14:16 AM UTC-5, Stephen Pelc wrote:

> Why not? Syntax colouring editors have been around for a long time.
>

Unsure if editor syntax coloring is robust enough. Forth has little syntax so
each word will need to be listed. May be sufficient for the standard words but
when additional word-sets are loaded, the editor's syntax coloring will need
to be updated. Is this a problem? Color Forth wouldn't have this problem as
each word has embedded color information (I assume). But then will need some
means of having the Forth interact with the editor display. If Forth words
have a consistent syntax, then editor syntax coloring would have little
problem.
One solution is to have syntax, even if no one likes it, and the editor
displays the word without the syntax but in color based on the syntax
the editor sees. I do that now with comment tags where the pager (less)
converts the tags to color escape codes. The comment text is shown in
color without the tag.
--
me

Re: Naming for parsing words

<2b28a887-e557-4b0a-9ba6-d6b0bb0a8895n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18118&group=comp.lang.forth#18118

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:4454:0:b0:69f:c339:e2dc with SMTP id r81-20020a374454000000b0069fc339e2dcmr36445965qka.771.1653937271032;
Mon, 30 May 2022 12:01:11 -0700 (PDT)
X-Received: by 2002:a05:620a:12c6:b0:6a3:74b1:bf57 with SMTP id
e6-20020a05620a12c600b006a374b1bf57mr29833204qkl.330.1653937270819; Mon, 30
May 2022 12:01:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 30 May 2022 12:01:10 -0700 (PDT)
In-Reply-To: <10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:3400:4473:a593:8d3f;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:3400:4473:a593:8d3f
References: <t60i6r$7m0$1@dont-email.me> <t70h7u$5jc$1@dont-email.me>
<db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com> <t70nh4$6ia$1@dont-email.me>
<t72qgm$qdl$1@dont-email.me> <10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2b28a887-e557-4b0a-9ba6-d6b0bb0a8895n@googlegroups.com>
Subject: Re: Naming for parsing words
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Mon, 30 May 2022 19:01:11 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2547
 by: S Jack - Mon, 30 May 2022 19:01 UTC

I have a word LSWT to list Forth words by type, for example the following
lists constants:

consts lswt
CURRENT and CONTEXT are FORTH
SEETABLE SEETABLECount BIT6 MASK5BITS DEADBEEF SEEK_END SEEK_CUR
SEEK_SET RWRR RW WO RO zlitbl zhitbl \T '/' ',' '_' ')' '(' EOT ETX STX
SOH FAM:RW ascR ERRIOR ERRFIG MPAD:END MPAD:MASK MPAD:LIMIT CST.BTREK
CST.START CS0 CSI FIN \N RAWIO SYSARGS SYSCMDL SYSOPTION SHELL PARMS4
DO2AVAL DOAVAL DODOE DOUSR DO2VAR DO2VAL DO2CON DOVAR DOVAL DOCON DOCOL
CST_IF SMAX CHAR STDERR STDOUT STDIN EPIPE EINTR O_NONBLOCK O_APPEND
O_TRUNC O_EXCL O_CREAT O_RDWR O_WRONLY O_RDONLY SYS_FORK SYS_EXECVE
SYS_WAITPID SYS_BRK SYS_CREAT SYS_WRITE SYS_READ SYS_CLOSE SYS_OPEN
SYS_EXIT REC/BLK BFMAGIC IORMAP #BUFF DOVDO DOVEC 0x80 B/SCR B/BUF
TAREAZ TAREA MPADZ MPADB SIBZ SIBB IPCOBZ IPCOB IPCIBZ IPCIB FBUFZ FBUF
MACBZ MACB EM LIMIT FIRST WNMAX C/L BL FALSE TRUE CELL-1 -CELL CELL
FOUR THREE TWO MONE ONE ZERO ok

The word type is determined by its codeword and for defining word
offspring an additional address. As a Forth word's type can be
determined by codeword and an address, any Forth has information
that it can use for coloring.
--
me

Re: Naming for parsing words

<t734n8$cev$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18119&group=comp.lang.forth#18119

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 23:08:21 +0400
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <t734n8$cev$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me> <t70h7u$5jc$1@dont-email.me>
<db5fe8a6-6806-472b-9518-08cc28beabe6n@googlegroups.com>
<t70nh4$6ia$1@dont-email.me> <t72qgm$qdl$1@dont-email.me>
<10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 May 2022 19:08:24 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="409de6c4fc5ecdab5af95a3984c77c61";
logging-data="12767"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+w+S2uAcOaE6a4emqJwFcb"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:L6yJ3pmPEILymMrgPp17eXZ0mrM=
In-Reply-To: <10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Mon, 30 May 2022 19:08 UTC

On 2022-05-30 20:58, S Jack wrote:
> On Monday, May 30, 2022 at 11:14:16 AM UTC-5, Stephen Pelc wrote:
>
>> Why not? Syntax colouring editors have been around for a long time.
>>
>
> Unsure if editor syntax coloring is robust enough. Forth has little syntax so
> each word will need to be listed. May be sufficient for the standard words but
> when additional word-sets are loaded, the editor's syntax coloring will need
> to be updated. Is this a problem?

> Color Forth wouldn't have this problem as
> each word has embedded color information (I assume). But then will need some
> means of having the Forth interact with the editor display.

In colorForth a color *is* a syntax. It's not a syntax highlighting by
an editor, it's a syntax itself.

A definition

: foo ( flag -- ) if 123 . then ;

is written as

red:foo

white:(
white:flag
white:--
white:)

green:if
green:123
green:.
green:then

green:;

NB: "Green words like if are compiled, but because they are in the macro
wordlist and act like immediate words, they are executed at compile time
like words written explicitly in yellow." [1]

> If Forth words
> have a consistent syntax, then editor syntax coloring would have little
> problem.
> One solution is to have syntax, even if no one likes it, and the editor
> displays the word without the syntax but in color based on the syntax
> the editor sees. I do that now with comment tags where the pager (less)
> converts the tags to color escape codes. The comment text is shown in
> color without the tag.
> --
> me

[1] The colorForth Editor
http://www.greenarraychips.com/home/documents/greg/cf-editor.htm

[2] colorForth
https://colorforth.github.io/cf.htm

[3] Pre-parsed words
https://colorforth.github.io/parsed.html

--
Ruvim

Re: Naming for parsing words

<nnd$7788a7ec$53f7b066@b94397c952adb06c>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18120&group=comp.lang.forth#18120

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
References: <t60i6r$7m0$1@dont-email.me> <t706bv$rog$1@gioia.aioe.org> <t70dnb$to4$1@dont-email.me> <t72l7e$ds5$1@dont-email.me>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$7788a7ec$53f7b066@b94397c952adb06c>
Organization: KPN B.V.
Date: Mon, 30 May 2022 21:10:32 +0200
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr2.eu1.usenetexpress.com!94.232.112.245.MISMATCH!abe005.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 42
Injection-Date: Mon, 30 May 2022 21:10:32 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Mon, 30 May 2022 19:10 UTC

In article <t72l7e$ds5$1@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:
>On 2022-05-29 22:23, Ruvim wrote:
>> On 2022-05-29 20:18, dxforth wrote:
>
>>> I don't care for its length but at least [UNDEFINED] is unambiguous.
>>> Were shortness paramount I'd have chosen LACK.  But hey, we need to
>>> keep Forth respectable and starched shirts sell better.
>>
>>
>>   lack( foo ) [if]
>>      ...
>>   [then]
>>
>> Nice!
>
>
>Probably, readability of following
>
> "foo" lack [if] ... [then]
>
>is not worser.

In ciforth the basic dictionary search is FOUND
"foo" FOUND
leaves an address or NULL if not found.
So [DEFINED] is not needed, but neither are [IF] [THEN]

"2DROP" FOUND 0=
" : 2DROP DROP DROP ; " ROT AND EVALUATE

Hallmark of a sound design ?

>--
>Ruvim

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Naming for parsing words

<e6d36b37-f5b0-4450-9790-4ed4e8a0143bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18121&group=comp.lang.forth#18121

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5bef:0:b0:462:3126:1765 with SMTP id k15-20020ad45bef000000b0046231261765mr34615154qvc.126.1653938059622;
Mon, 30 May 2022 12:14:19 -0700 (PDT)
X-Received: by 2002:a0c:fa81:0:b0:461:e391:820b with SMTP id
o1-20020a0cfa81000000b00461e391820bmr47137487qvn.6.1653938059421; Mon, 30 May
2022 12:14:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 30 May 2022 12:14:19 -0700 (PDT)
In-Reply-To: <t70e47$905$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <t60i6r$7m0$1@dont-email.me> <t62vui$1mi$1@dont-email.me>
<2022May19.164709@mips.complang.tuwien.ac.at> <t6t9mi$buj$2@dont-email.me>
<nnd$1d4b97d3$073395e9@8abaa6da72b6b30c> <t706bv$rog$1@gioia.aioe.org>
<796382cb-51a2-49d4-8c12-913faede4cb3n@googlegroups.com> <t70e47$905$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e6d36b37-f5b0-4450-9790-4ed4e8a0143bn@googlegroups.com>
Subject: Re: Naming for parsing words
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Mon, 30 May 2022 19:14:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1930
 by: Hans Bezemer - Mon, 30 May 2022 19:14 UTC

On Sunday, May 29, 2022 at 8:30:33 PM UTC+2, Ruvim wrote:
> But having shorter string literals it looks better:
> "x" var
> or
> `x var
> 10 `x const

That is a very personal metric. I see strings - not declarations. And I think prefixed
words are b--t ugly.

> Anyway, what can you suggest if I need to create a definition (e.g. a
> constant) programmatically, and its name is passed as an argument?
> Having "const" from the above it could look as:
>
> : foo ( sd.name -- ) ... 10 -rot const ... ;

Try "CREATE". It has been there for a long time.

Hans Bezemer

Re: Naming for parsing words

<t73avi$s43$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18122&group=comp.lang.forth#18122

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: step...@vfxforth.com (Stephen Pelc)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 20:55:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <t73avi$s43$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me> <t70nh4$6ia$1@dont-email.me> <t72qgm$qdl$1@dont-email.me> <10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 May 2022 20:55:14 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="edda3ada093cb599a5c378d31317be98";
logging-data="28803"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4gqD3sVHtTG/ne0PbW2BG"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:yipgJiEl13PUiD0huFCHWE++yQw=
X-Usenapp: v1.20/l - Full License
 by: Stephen Pelc - Mon, 30 May 2022 20:55 UTC

On 30 May 2022 at 18:58:26 CEST, "S Jack" <sdwjack69@gmail.com> wrote:

> On Monday, May 30, 2022 at 11:14:16 AM UTC-5, Stephen Pelc wrote:
>
>> Why not? Syntax colouring editors have been around for a long time.
>>
>
> Unsure if editor syntax coloring is robust enough.

Well, find out, otherwise this proposal is in the class "I want someone else
to do all the work".

Stephen

--
Stephen Pelc, stephen@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads

Re: Naming for parsing words

<t73b3q$sv0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18123&group=comp.lang.forth#18123

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: step...@vfxforth.com (Stephen Pelc)
Newsgroups: comp.lang.forth
Subject: Re: Naming for parsing words
Date: Mon, 30 May 2022 20:57:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <t73b3q$sv0$1@dont-email.me>
References: <t60i6r$7m0$1@dont-email.me> <t72qgm$qdl$1@dont-email.me> <10541a74-2103-46a6-9221-c2eeba08df4bn@googlegroups.com> <2b28a887-e557-4b0a-9ba6-d6b0bb0a8895n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 May 2022 20:57:30 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="edda3ada093cb599a5c378d31317be98";
logging-data="29664"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19M3059ZclAHHJ+f2xIFYzj"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:/TuY0dIECLErxAVuP9Ld0t0YIcw=
X-Usenapp: v1.20/l - Full License
 by: Stephen Pelc - Mon, 30 May 2022 20:57 UTC

On 30 May 2022 at 21:01:10 CEST, "S Jack" <sdwjack69@gmail.com> wrote:
>
> The word type is determined by its codeword and for defining word
> offspring an additional address. As a Forth word's type can be
> determined by codeword and an address, any Forth has information
> that it can use for coloring.

Does that apply to Native Code Compilers?

Stephen
--
Stephen Pelc, stephen@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads

Pages:12345
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor