Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"I prefer to think that God is not dead, just drunk" -- John Huston


devel / comp.lang.forth / Re: Fix VFX FIND

SubjectAuthor
* POSTPONEing literals?dxforth
`* Re: POSTPONEing literals?Hugh Aguilar
 +* Re: POSTPONEing literals?dxforth
 |+* Re: POSTPONEing literals?Anton Ertl
 ||`* Re: POSTPONEing literals?dxforth
 || `* Re: POSTPONEing literals?Anton Ertl
 ||  `* Re: POSTPONEing literals?dxforth
 ||   +- Re: POSTPONEing literals?dxforth
 ||   +* Re: POSTPONEing literals?Ruvim
 ||   |`* Re: POSTPONEing literals?dxforth
 ||   | `- Re: POSTPONEing literals?Ruvim
 ||   `- Re: POSTPONEing literals?Anton Ertl
 |`* Re: POSTPONEing literals?dxforth
 | `* Re: POSTPONEing literals?dxforth
 |  `* Re: POSTPONEing literals?Anton Ertl
 |   +* Re: POSTPONEing literals?dxforth
 |   |`* Re: POSTPONEing literals?Anton Ertl
 |   | +* Re: POSTPONEing literals?Ruvim
 |   | |`* Re: POSTPONEing literals?dxforth
 |   | | `* Re: POSTPONEing literals?Ruvim
 |   | |  +* Re: POSTPONEing literals?none
 |   | |  |`* Re: POSTPONEing literals?Ruvim
 |   | |  | `* Re: POSTPONEing literals?none
 |   | |  |  `* Re: POSTPONEing literals?Ruvim
 |   | |  |   `- Re: POSTPONEing literals?none
 |   | |  `* Re: POSTPONEing literals?dxforth
 |   | |   `* Re: POSTPONEing literals?Ruvim
 |   | |    `* Re: POSTPONEing literals?dxforth
 |   | |     +* Re: POSTPONEing literals?Ruvim
 |   | |     |+* Re: POSTPONEing literals?Hugh Aguilar
 |   | |     ||`- Re: POSTPONEing literals?dxforth
 |   | |     |`* Re: POSTPONEing literals?dxforth
 |   | |     | +* Re: POSTPONEing literals?Ruvim
 |   | |     | |+- VFX bug in COMPILE, (was: POSTPONEing literals?)Ruvim
 |   | |     | |+* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | ||+* Re: POSTPONEing literals?Anton Ertl
 |   | |     | |||`* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | ||| +* Re: POSTPONEing literals?Ruvim
 |   | |     | ||| |`* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | ||| | `* Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |  `* Re: Fix VFX FIND (was: POSTPONEing literals?)Stephen Pelc
 |   | |     | ||| |   +* Re: Fix VFX FINDRuvim
 |   | |     | ||| |   |`* Re: Fix VFX FINDStephen Pelc
 |   | |     | ||| |   | `- Re: Fix VFX FINDRuvim
 |   | |     | ||| |   +* Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   |+* Re: Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |   ||`* Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   || +* Re: Fix VFX FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | ||| |   || |`* Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | +- Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   || | +* Re: Fix VFX FIND (was: POSTPONEing literals?)Krishna Myneni
 |   | |     | ||| |   || | |`* Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | | `* Re: Fix VFX FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | ||| |   || | |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)dxforth
 |   | |     | ||| |   || | |  `* single-xt and dual-xt approaches (was: Fix VFX FIND)Ruvim
 |   | |     | ||| |   || | |   +- Re: single-xt and dual-xt approaches (was: Fix VFX FIND)none
 |   | |     | ||| |   || | |   `- Re: single-xt and dual-xt approaches (was: Fix VFX FIND)dxforth
 |   | |     | ||| |   || | `- Re: Fix VFX FIND (was: POSTPONEing literals?)dxforth
 |   | |     | ||| |   || `- Re: Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |   |`* Re: Fix VFX FIND (was: POSTPONEing literals?)Stephen Pelc
 |   | |     | ||| |   | `* Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)Stephen Pelc
 |   | |     | ||| |   |  `- Re: Fix VFX FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | ||| |   `- Re: Fix VFX FIND (was: POSTPONEing literals?)none
 |   | |     | ||| `* Re: POSTPONEing literals?Anton Ertl
 |   | |     | |||  +* Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |+- FIND clarification rationale (was: POSTPONEing literals?)Ruvim
 |   | |     | |||  |+- Re: POSTPONEing literals?Anton Ertl
 |   | |     | |||  |`* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | |||  | +- Re: POSTPONEing literals?Ruvim
 |   | |     | |||  | `* Re: POSTPONEing literals?dxforth
 |   | |     | |||  |  +- Re: POSTPONEing literals?none
 |   | |     | |||  |  +* Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |  |+* Re: POSTPONEing literals?none
 |   | |     | |||  |  ||`- Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |  |`* Re: POSTPONEing literals?dxforth
 |   | |     | |||  |  | +* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | |||  |  | |`- Re: POSTPONEing literals?dxforth
 |   | |     | |||  |  | `- Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |  `- Re: POSTPONEing literals?Doug Hoffman
 |   | |     | |||  `* Re: POSTPONEing literals?Marcel Hendrix
 |   | |     | |||   +- Re: POSTPONEing literals?Ruvim
 |   | |     | |||   `- Re: POSTPONEing literals?Anton Ertl
 |   | |     | ||`- Re: POSTPONEing literals?Ruvim
 |   | |     | |`* Re: POSTPONEing literals?dxforth
 |   | |     | | `* Re: POSTPONEing literals?Anton Ertl
 |   | |     | |  `* Re: POSTPONEing literals?dxforth
 |   | |     | |   `* Re: POSTPONEing literals?Ruvim
 |   | |     | |    `* Re: POSTPONEing literals?dxforth
 |   | |     | |     `* Re: POSTPONEing literals?P Falth
 |   | |     | |      `* Re: POSTPONEing literals?Ruvim
 |   | |     | |       +* Alternative to FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | |       |`* Re: Alternative to FIND (was: POSTPONEing literals?)P Falth
 |   | |     | |       | +* Re: Alternative to FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | |       | |`- Re: Alternative to FIND (was: POSTPONEing literals?)P Falth
 |   | |     | |       | `* Re: Alternative to FINDRuvim
 |   | |     | |       |  `* Re: Alternative to FINDP Falth
 |   | |     | |       |   +- Re: Alternative to FINDminf...@arcor.de
 |   | |     | |       |   +* Re: Alternative to FINDRuvim
 |   | |     | |       |   `* Re: Alternative to FINDStephen Pelc
 |   | |     | |       `* Re: POSTPONEing literals?P Falth
 |   | |     | `- Re: POSTPONEing literals?Stephen Pelc
 |   | |     `* Re: POSTPONEing literals?Anton Ertl
 |   | `- Re: POSTPONEing literals?dxforth
 |   `- Re: POSTPONEing literals?none
 `* Re: POSTPONEing literals?azathot...@gmail.com

Pages:123456789
Re: Fix VFX FIND

<609be816.2758796@news.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: step...@mpeforth.com (Stephen Pelc)
Newsgroups: comp.lang.forth
Subject: Re: Fix VFX FIND
Date: Wed, 12 May 2021 14:44:37 GMT
Organization: MPE
Lines: 44
Message-ID: <609be816.2758796@news.eternal-september.org>
References: <s6a8o8$va3$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org> <2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me> <s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me> <s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me> <s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me> <60926f06.2412281@news.eternal-september.org> <2021May5.134626@mips.complang.tuwien.ac.at> <6092aa60.13264203@news.eternal-september.org> <s6umuu$1bd$1@dont-email.me> <6093c11b.3105218@news.eternal-september.org> <s737aq$68j$1@dont-email.me> <609aa2c8.1456671@news.eternal-september.org> <s7eefm$hst$1@dont-email.me>
Reply-To: stephen@mpeforth.com
Injection-Info: reader02.eternal-september.org; posting-host="8c9b91dee828a109acbf3487790aea81";
logging-data="30981"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19++Rd1lawHc4+mfAiuRG9v"
Cancel-Lock: sha1:Mh0CDWVnscnHQoH7KVeqdpJgT48=
X-Newsreader: Forte Free Agent 1.21/32.243
 by: Stephen Pelc - Wed, 12 May 2021 14:44 UTC

On Tue, 11 May 2021 20:21:57 +0300, Ruvim <ruvim.pinka@gmail.com>
wrote:

>> Personally, and for MPE, I love the original idea of an xt that it
>> be the single point of contact between the user and the word. An
>> xt can be used for many purposes other than compilation and
>> interpretation, e.g. LOCATE XREF and so on.
>
>I don't see how can a user use an xt with LOCATE or XREF

: locate ' (locate) ;

>> Use of xt in this way requires that all words have a primary or
>> interpretation action, which the xt represents.
>>
>> Your fix breaks this and I suppose makes it non-standard.
>
>How does my fix break this?

It does not distinguish between NDCS and IMMEDIATE. It just
ignores the problem.

>> Regardless of nt or xt, I see no way of dealing with NDCS words
>> without upgrading the standard.
>
>Could you please clarify, what cannot a standard program do without
>special words to handle NDCS words?

A standard system cannot provide facilities for NDCS words
without introducing state-smart words. NDCS words allows us
to provide standards compliant code for things like interpretive
DO ... LOOP and so on.

The great strength of NDCS words is that they permit easy
implementation of notations that are at present difficult.

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
web: http://www.mpeforth.com - free VFX Forth downloads

Re: Alternative to FIND

<2021May12.181706@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Alternative to FIND
Date: Wed, 12 May 2021 16:17:06 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 26
Message-ID: <2021May12.181706@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <s70t6p$tql$1@dont-email.me> <s70uis$94c$1@dont-email.me> <1b2fbcdd-68e9-4e3e-995b-51f2f7d2bdf7n@googlegroups.com> <s7buca$r8e$1@dont-email.me> <721974e8-0e94-4c4e-b2c8-52c724ceeb13n@googlegroups.com> <s7e2ug$c08$1@dont-email.me> <0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com> <s7g62e$15c$1@dont-email.me> <3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com> <s7gevk$dlg$1@dont-email.me> <c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="113c21cb184098292786791c2c20a4b3";
logging-data="8405"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vVUZAC++s1WpEQYZqLxd7"
Cancel-Lock: sha1:HFGMqu61DauIwPHLLF4B9uisLP0=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 12 May 2021 16:17 UTC

P Falth <peter.m.falth@gmail.com> writes:
>There is another problem waiting for a user defined text interpreter and th=
>at
>is locals. They will not be found by FIND ( or find-name, search-wordlist e=
>tc)
>and they do not have an xt. They are stored in a specific table that is set=
>up
>and destroyed at : and ; =20

We have discussed this in
<https://forth-standard.org/standard/locals#contribution-137>; one
thing I found was:

|In VFX and Gforth, FIND finds [a local]; in SwiftForth, iForth, and
|lxf, FIND does not.
| |Apparently this has not been an issue for 26 years, so apparently
|nobody has used a user-defined text interpreter to process a program
|using locals on SwiftForth, iForth, or lxf

- 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 2020: https://euro.theforth.net/2020

Re: Alternative to FIND

<7b61f72e-091e-4199-80ae-b81c2a7419f6n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:9e12:: with SMTP id h18mr34605705qke.483.1620839620783;
Wed, 12 May 2021 10:13:40 -0700 (PDT)
X-Received: by 2002:a37:ac17:: with SMTP id e23mr34928922qkm.184.1620839620564;
Wed, 12 May 2021 10:13:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.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: Wed, 12 May 2021 10:13:40 -0700 (PDT)
In-Reply-To: <2021May12.181706@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:5d6c:e4aa:5db0:b77c:6112;
posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:5d6c:e4aa:5db0:b77c:6112
References: <s6a8o8$va3$1@gioia.aioe.org> <s70t6p$tql$1@dont-email.me>
<s70uis$94c$1@dont-email.me> <1b2fbcdd-68e9-4e3e-995b-51f2f7d2bdf7n@googlegroups.com>
<s7buca$r8e$1@dont-email.me> <721974e8-0e94-4c4e-b2c8-52c724ceeb13n@googlegroups.com>
<s7e2ug$c08$1@dont-email.me> <0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com>
<s7g62e$15c$1@dont-email.me> <3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com>
<s7gevk$dlg$1@dont-email.me> <c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com>
<2021May12.181706@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7b61f72e-091e-4199-80ae-b81c2a7419f6n@googlegroups.com>
Subject: Re: Alternative to FIND
From: peter.m....@gmail.com (P Falth)
Injection-Date: Wed, 12 May 2021 17:13:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3188
 by: P Falth - Wed, 12 May 2021 17:13 UTC

On Wednesday, 12 May 2021 at 18:53:24 UTC+2, Anton Ertl wrote:
> P Falth <peter....@gmail.com> writes:
> >There is another problem waiting for a user defined text interpreter and th=
> >at
> >is locals. They will not be found by FIND ( or find-name, search-wordlist e=
> >tc)
> >and they do not have an xt. They are stored in a specific table that is set=
> >up
> >and destroyed at : and ; =20
>
> We have discussed this in
> <https://forth-standard.org/standard/locals#contribution-137>; one
> thing I found was:
>
> |In VFX and Gforth, FIND finds [a local]; in SwiftForth, iForth, and
> |lxf, FIND does not.
> |
> |Apparently this has not been an issue for 26 years, so apparently
> |nobody has used a user-defined text interpreter to process a program
> |using locals on SwiftForth, iForth, or lxf
> - anton

Yes it is obvious that nobody has done this!

Also looking at the 2012 standard section 13.3.3.2 Syntax restrictions
I see point e) with the following text

"Words that return execution tokens, such as ’ (tick), [’], or FIND,
shall not be used with local names;"

BR
Peter

> 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 2020: https://euro.theforth.net/2020

Re: Fix VFX FIND (was: POSTPONEing literals?)

<55f55965-830a-4d0d-9e19-f380eca8a958n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1049:: with SMTP id f9mr34477881qte.140.1620846097237; Wed, 12 May 2021 12:01:37 -0700 (PDT)
X-Received: by 2002:a37:a988:: with SMTP id s130mr35757423qke.325.1620846097092; Wed, 12 May 2021 12:01:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 12 May 2021 12:01:36 -0700 (PDT)
In-Reply-To: <609aa2c8.1456671@news.eternal-september.org>
Injection-Info: google-groups.googlegroups.com; posting-host=92.233.200.53; posting-account=vspE8woAAABMK67BtjVBwn5OkceFYJAA
NNTP-Posting-Host: 92.233.200.53
References: <s6a8o8$va3$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org> <2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me> <s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me> <s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me> <s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me> <60926f06.2412281@news.eternal-september.org> <2021May5.134626@mips.complang.tuwien.ac.at> <6092aa60.13264203@news.eternal-september.org> <s6umuu$1bd$1@dont-email.me> <6093c11b.3105218@news.eternal-september.org> <s737aq$68j$1@dont-email.me> <609aa2c8.1456671@news.eternal-september.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <55f55965-830a-4d0d-9e19-f380eca8a958n@googlegroups.com>
Subject: Re: Fix VFX FIND (was: POSTPONEing literals?)
From: pauldli...@btopenworld.com (Paul Liles)
Injection-Date: Wed, 12 May 2021 19:01:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 71
 by: Paul Liles - Wed, 12 May 2021 19:01 UTC

On Tuesday, May 11, 2021 at 4:50:48 PM UTC+1, Stephen Pelc wrote:

> The fix is the sensible one, which is to throw away IMMEDIATE and
> let FIND indicate NDCS and normal. However, on some systems this
> will be a code breaker.

I tend to think that the obvious fix is at the other end!

All implementations of NDCS have the same sort of logic:
- find an xt for a name
- if immediate, execute it
- if NDCS execute its compilation semantics
- if neither, append its execution semantics.

Exactly how this logic is distributed between FIND, the text interpreter,
COMPILE, and possibly NAME>COMPILE is implementation dependent. It depends
at least on what words can be found, on the dictionary structure and on
what characteristics of a word (such as immediacy) you can derive from the
execution token.

And that's fine by me. One of the things I most like about the standard is
that it is forgiving of different implementations.

When it comes to implementing NDCS words, though, it does mean that it
is very unlikely, maybe actually impossible, to define "NDCS," or
whetever we call it in a way that will satisfy all the different flavours
of Forth.

That means we will have to rely on defining the standard in such a way
that different implementations of NDCS words can work, leaving the
underlying details to the implementation.

FIND is already defined very permissively (to the extent that I have
real trouble sometimes understanding some of the discussions about it)
and so far as I can tell is adequate to the job, even if those of us with
single-xt systems find it a bit bizarre.

COMPILE, on the other hand is very prescriptive and unforgiving. I
would propose changing the specification of COMPILE, to "perform the
compilation semantics of xt" and leave it to implementers to decide
what xts it can safely be fed, which will vary depending on the
type of Forth that we have.

I'd expect, for example, that a VFX-type Forth would have NDCS, as
a component of COMPILE, and POSTPONE, and that a Gforth-type Forth
would have something similar as a component of FIND and POSTPONE
and as a return value of NAME>COMPILE.

(It is completely possible that everything I have said is rubbish,
as I am pretty new to Forth and have only been doing it for about
two years.)


> Personally, and for MPE, I love the original idea of an xt that it
> be the single point of contact between the user and the word. An
> xt can be used for many purposes other than compilation and
> interpretation, e.g. LOCATE XREF and so on.

Indeed. I find it really hard to get my head around any other
approach, particularly as the xt is at the root of my HELP
system and it would be downright silly to not allow a user to
get help on something anyplace anytime.
> Use of xt in this way requires that all words have a primary or
> interpretation action, which the xt represents. Your fix breaks
> this and I suppose makes it non-standard.

It does mean that all words have a primary action, it doesn't
necessarily follow that the primary action is the interpretation
action (for example, control-flow words). (I think!)

Re: Alternative to FIND

<de9450ca-8abc-4f16-83a3-f7fbbe4b9473n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:11b7:: with SMTP id c23mr21191701qkk.235.1620851331435; Wed, 12 May 2021 13:28:51 -0700 (PDT)
X-Received: by 2002:a0c:ef83:: with SMTP id w3mr24837514qvr.38.1620851331151; Wed, 12 May 2021 13:28:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 12 May 2021 13:28:50 -0700 (PDT)
In-Reply-To: <2021May12.181706@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:5d6c:e4aa:5db0:b77c:6112; posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:5d6c:e4aa:5db0:b77c:6112
References: <s6a8o8$va3$1@gioia.aioe.org> <s70t6p$tql$1@dont-email.me> <s70uis$94c$1@dont-email.me> <1b2fbcdd-68e9-4e3e-995b-51f2f7d2bdf7n@googlegroups.com> <s7buca$r8e$1@dont-email.me> <721974e8-0e94-4c4e-b2c8-52c724ceeb13n@googlegroups.com> <s7e2ug$c08$1@dont-email.me> <0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com> <s7g62e$15c$1@dont-email.me> <3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com> <s7gevk$dlg$1@dont-email.me> <c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com> <2021May12.181706@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <de9450ca-8abc-4f16-83a3-f7fbbe4b9473n@googlegroups.com>
Subject: Re: Alternative to FIND
From: peter.m....@gmail.com (P Falth)
Injection-Date: Wed, 12 May 2021 20:28:51 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 35
 by: P Falth - Wed, 12 May 2021 20:28 UTC

On Wednesday, 12 May 2021 at 18:53:24 UTC+2, Anton Ertl wrote:
> P Falth <peter....@gmail.com> writes:
> >There is another problem waiting for a user defined text interpreter and th=
> >at
> >is locals. They will not be found by FIND ( or find-name, search-wordlist e=
> >tc)
> >and they do not have an xt. They are stored in a specific table that is set=
> >up
> >and destroyed at : and ; =20
>
> We have discussed this in
> <https://forth-standard.org/standard/locals#contribution-137>; one
> thing I found was:

The test you use in the discussion:

: x c" fluffystunk" ; : foo locals| fluffystunk | [ x find cr .s 2drop ] ;

Will fail on lxf for 2 reasons
- FIND will not search locals as they are not in a wordlist
- Locals can anyway only be found when state is compiling in lxf

Peter
> |In VFX and Gforth, FIND finds [a local]; in SwiftForth, iForth, and
> |lxf, FIND does not.
> |
> |Apparently this has not been an issue for 26 years, so apparently
> |nobody has used a user-defined text interpreter to process a program
> |using locals on SwiftForth, iForth, or lxf
> - 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<s7i7dk$1d2b$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: POSTPONEing literals?
Date: Thu, 13 May 2021 13:45:55 +1000
Organization: Aioe.org NNTP Server
Lines: 12
Message-ID: <s7i7dk$1d2b$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me>
<s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me>
<60926f06.2412281@news.eternal-september.org>
<2021May5.134626@mips.complang.tuwien.ac.at>
<6092aa60.13264203@news.eternal-september.org>
<2021May8.123458@mips.complang.tuwien.ac.at> <s76o51$g1v$1@dont-email.me>
<609939ac.4184687@news.eternal-september.org> <s7d1v6$jgs$1@gioia.aioe.org>
<s7dnf0$fjm$1@dont-email.me> <s7gnh4$gb$1@gioia.aioe.org>
<609be590.2112296@news.eternal-september.org>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 13 May 2021 03:45 UTC

On 13/05/2021 00:27, Stephen Pelc wrote:
> On Thu, 13 May 2021 00:08:37 +1000, dxforth <dxforth@gmail.com> wrote:
>
>>Probably those within Standard Forth didn't need it either, because if
>>FIND wasn't fit for purpose it would surely have been fixed by now.
>
> Forth has changed since the 1990s and flwas in the 1990s documents
> are being revealed.

What ANS reveals is Forth's Curse - willingness to chase the latest
and greatest idea at the expense of a stable environment in which
application development can take root.

Re: POSTPONEing literals?

<s7iiqh$9r1$1@dont-email.me>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 13 May 2021 10:00:32 +0300
Organization: A noiseless patient Spider
Lines: 67
Message-ID: <s7iiqh$9r1$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me>
<s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me>
<60926f06.2412281@news.eternal-september.org>
<2021May5.134626@mips.complang.tuwien.ac.at>
<6092aa60.13264203@news.eternal-september.org>
<2021May8.123458@mips.complang.tuwien.ac.at> <s76o51$g1v$1@dont-email.me>
<609939ac.4184687@news.eternal-september.org> <s7d1v6$jgs$1@gioia.aioe.org>
<s7dnf0$fjm$1@dont-email.me> <s7gnh4$gb$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 May 2021 07:00:33 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4a16db061bfb1fe3592890c0b77b0bc3";
logging-data="10081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nM/cM0vmIzQfJpe4wX6AP"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:FjC5Jzd247OWSYSIVxumXUmdVSc=
In-Reply-To: <s7gnh4$gb$1@gioia.aioe.org>
Content-Language: en-US
 by: Ruvim - Thu, 13 May 2021 07:00 UTC

On 2021-05-12 17:08, dxforth wrote:
> On 11/05/2021 20:49, Ruvim wrote:
>> On 2021-05-11 07:42, dxforth wrote:
>>> On 10/05/2021 23:58, Stephen Pelc wrote:
>> [...]
>>>> If we do not have standard ways (words) to handle NDCS words, we
>>>> cannot have standard tests. Now that VFX Forth handles IF and other
>>>> words as NDCS words, we need to add NDCS handling words to the
>>>> standard.
>>>
>>> Standard tests for what purpose?  First one must define the
>>> standard need i.e. why does FIND used in situation X need to
>>> produce the same result on every system?  ANS' premise in
>>> permitting implementers to do as they pleased was that not
>>> every situation required standardizing.
>>
>> Yes. But every standard word should be enough specified to be useful.
>>
>>
>>> Were they wrong?
>>
>> The specification for the FIND word is not sufficient.
>>
>> A.6.2.0945 says:
>>     The intention is that COMPILE, can be used as follows
>>     to write the classic interpreter/compiler loop:
>>
>>     ...                                               ( c-addr )
>>     FIND ?DUP IF                                        ( xt +-1 )
>>       STATE @ IF                                        ( xt +-1 )
>>         0> IF EXECUTE ELSE COMPILE, THEN      ( ??? )
>>       ELSE                                        ( xt +-1 )
>>         DROP EXECUTE                        ( ??? )
>>       THEN
>>     ELSE                                              ( c-addr )
>>       ( whatever you do for an undefined word )
>>     THEN
>>     ...
>>
>> Some systems implement FIND in such a way that this loop doesn't work as
>> expected for the words with non default interpretation semantics.
>>
>>> I couldn't find a single app I'd written that used FIND :)
>>
>> Probably you just didn't ever need a user-defined text interpreter for
>> some advanced DSL (domain specific language), or some advanced extension
>> of a Forth system.
>
> Probably those within Standard Forth didn't need it either, because if
> FIND wasn't fit for purpose it would surely have been fixed by now.

Your conclusion could be right if in the most systems FIND was incapable
to implement user-defined text interpreter. But it seems, such systems
comprise the minority.

"FIND" was standardized in Forth-83, and it just always worked as
expected (in all standard Forth systems that provide this word). But
only in 200x (please correct if I'm wrong) some dual-xt systems appeared
that provides FIND that incapable to implement user-defined text
interpreter.

So those who need the full-fledged "FIND" just uses systems which
provide such "FIND".

--
Ruvim

Re: Fix VFX FIND (was: POSTPONEing literals?)

<609cf44e$0$29338$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
Subject: Re: Fix VFX FIND (was: POSTPONEing literals?)
References: <s6a8o8$va3$1@gioia.aioe.org> <6093c11b.3105218@news.eternal-september.org> <s737aq$68j$1@dont-email.me> <609aa2c8.1456671@news.eternal-september.org>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 13 May 2021 09:41:34 GMT
Lines: 43
Message-ID: <609cf44e$0$29338$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 39c25431.news.xs4all.nl
X-Trace: G=x5u+ychC,C=U2FsdGVkX1/zo5Jl6OGnLu65wcs2mbJu3UYhmwUvIzVwxYKhbFutIzxug6JVmYvGRQV2ozAtZTxZ7swd/aK8X7+Xk1QtG93l+Uc9wX7RamVYYB2/Jjv2wvPLxo6otiuH
X-Complaints-To: abuse@xs4all.nl
 by: none - Thu, 13 May 2021 09:41 UTC

In article <609aa2c8.1456671@news.eternal-september.org>,
Stephen Pelc <stephen@mpeforth.com> wrote:
<SNIP>
>Personally, and for MPE, I love the original idea of an xt that it
>be the single point of contact between the user and the word. An
>xt can be used for many purposes other than compilation and
>interpretation, e.g. LOCATE XREF and so on.

There is the major design flaw. If we look at lisp the central concept
is the symbol and even uncorrelated behaviours are associated with it.
Looking at Forth the central concept is the xt, a behaviour, which is
equally flawed.
Both are wrong in my opinion. The central concept should
be neither an action, nor a name, but more abstract and allowing for
properties such as actions or names or DMCF (whatever that is.)
Such an "object" can remain without name in some cases, or its name
is changed, it can be relinked into an other vocabulary, etc.
These objects could have several behaviour, or one, and some
behaviours could make no sense in some states, which is ok.
Important is that those properties belong together.
All kind of implementation defined properties can hang off such
an object. In tforth (1993) I proposed that only those tokens
could be passed between words, not exposing the internal fields
like in parameter field, data field, code field unnecessarily.
An enormous roadblock for this is the obsession of Forthers with
efficiency and speed.

Words say a lot. Neither execution taken, nor name token are
acceptable names for such objects, and will forever engender
misunderstandings. You know how I call those.
<SNIP>

>Because of SYNONYM and friends, there is an argument that the
>unique token for a word is the name token.
We are getting there. Now coin a proper name for this.

<SNIP>
>Stephen
--
"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: Alternative to FIND

<s7it91$5mb$1@dont-email.me>

  copy mid

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

  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: Alternative to FIND
Date: Thu, 13 May 2021 12:58:55 +0300
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <s7it91$5mb$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me>
<s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me>
<s6u558$76l$1@gioia.aioe.org> <2021May5.163707@mips.complang.tuwien.ac.at>
<s6vhvp$gqg$1@gioia.aioe.org> <s701p0$tlf$1@dont-email.me>
<s70and$1tle$1@gioia.aioe.org>
<c4c77b94-3598-4ae5-a74a-b6177a9edc85n@googlegroups.com>
<s70t6p$tql$1@dont-email.me> <s70uis$94c$1@dont-email.me>
<1b2fbcdd-68e9-4e3e-995b-51f2f7d2bdf7n@googlegroups.com>
<s7buca$r8e$1@dont-email.me>
<721974e8-0e94-4c4e-b2c8-52c724ceeb13n@googlegroups.com>
<s7e2ug$c08$1@dont-email.me>
<0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com>
<s7g62e$15c$1@dont-email.me>
<3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com>
<s7gevk$dlg$1@dont-email.me>
<c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 May 2021 09:58:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4a16db061bfb1fe3592890c0b77b0bc3";
logging-data="5835"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1jvu5LFOIcANZ/dGEH0BQ"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:rt0IyqEPVSLIraUxbIoeuv8T8t0=
In-Reply-To: <c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Thu, 13 May 2021 09:58 UTC

On 2021-05-12 15:12, P Falth wrote:
> On Wednesday, 12 May 2021 at 13:42:46 UTC+2, Ruvim wrote:
>> On 2021-05-12 13:58, P Falth wrote:
[...]
>>> I have looked thru all my sources. FIND is never used. in other peoples
>>> sources I have I see it used some time to define [DEFINED] . For
>>> this purpose my state dump find will work just fine.
>>> This also means that I can test a state-smart find without breaking my system!
>>>
>>> But what will I actually gain from it?
>>>
>> As an implementer — nothing direct gain.
>>
>> The users of your system can use some portable libraries and programs
>> that rely on FIND. Or the Forth users in general can choose your system
>> in more cases.
>>
>> For example, at the moment I cannot use your system, and one of the
>> issues is that a user-defined text interpreter doesn't work.
>
> There is another problem waiting for a user defined text interpreter and that
> is locals. They will not be found by FIND ( or find-name, search-wordlist etc)
> and they do not have an xt. They are stored in a specific table that is setup
> and destroyed at : and ;

As Anton pointed out, it was discussed.

My conclusion is that FIND is not obligated to find locals. And I'm not
convinced that FIND is allowed to traverse anything beyond the search order.

So the problem with locals in a user-defined text interpreter is not
about FIND, and this problem can be addressed to the Locals word set.
Also, Recognizer API should provide a recognizer for locals.

As a workaround, locals can be implemented in a portable way, but of
course not so efficient.

I personally barely use locals.

--
Ruvim

Re: Fix VFX FIND

<s7iv3t$agh$1@dont-email.me>

  copy mid

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

  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: Fix VFX FIND
Date: Thu, 13 May 2021 13:30:20 +0300
Organization: A noiseless patient Spider
Lines: 118
Message-ID: <s7iv3t$agh$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org>
<2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me>
<s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me>
<60926f06.2412281@news.eternal-september.org>
<2021May5.134626@mips.complang.tuwien.ac.at>
<6092aa60.13264203@news.eternal-september.org> <s6umuu$1bd$1@dont-email.me>
<6093c11b.3105218@news.eternal-september.org> <s737aq$68j$1@dont-email.me>
<609aa2c8.1456671@news.eternal-september.org> <s7eefm$hst$1@dont-email.me>
<609be816.2758796@news.eternal-september.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 13 May 2021 10:30:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4a16db061bfb1fe3592890c0b77b0bc3";
logging-data="10769"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iFfVPAnEfMGLmxd7zeGlN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:lW8gte7zRLf7wvNLfufwkZhQ0d4=
In-Reply-To: <609be816.2758796@news.eternal-september.org>
Content-Language: en-US
 by: Ruvim - Thu, 13 May 2021 10:30 UTC

On 2021-05-12 17:44, Stephen Pelc wrote:
> On Tue, 11 May 2021 20:21:57 +0300, Ruvim <ruvim.pinka@gmail.com>
> wrote:
>
>>> Personally, and for MPE, I love the original idea of an xt that it
>>> be the single point of contact between the user and the word. An
>>> xt can be used for many purposes other than compilation and
>>> interpretation, e.g. LOCATE XREF and so on.
>>
>> I don't see how can a user use an xt with LOCATE or XREF
>
> : locate ' (locate) ;

It's a system-specific (VFX-specific) use. Changes in VFX FIND don't
affect such use.

Even the following phrase:

' if >code-len @ (locate)

either works as expected in FVX, or doesn't work, regardless of FIND.

>>> Use of xt in this way requires that all words have a primary or
>>> interpretation action, which the xt represents.
>>>
>>> Your fix breaks this and I suppose makes it non-standard.

Well, at the first, my fix doesn't break this property in VFX: all words
in VFX still have a primary action and the corresponding xt.

At the second, the standard doesn't require any word to have
"interpretation action" which the xt represents.

For example, "interpretation action" for "IF" may be to throw "not
found" exception, and system might not provide any xt that represents
this action for "IF" (since FIND returns 0 for that case).

>> How does my fix break this?
>
> It does not distinguish between NDCS and IMMEDIATE. It just
> ignores the problem.

And what? Could you provide some standard-compliant code examples, that
shows this problem? It's not clear what particular problem do you mean.

>>> Regardless of nt or xt, I see no way of dealing with NDCS words
>>> without upgrading the standard.
>>
>> Could you please clarify, what cannot a standard program do without
>> special words to handle NDCS words?
>
> A standard system cannot provide facilities for NDCS words
> without introducing state-smart words. NDCS words allows us
> to provide standards compliant code for things like interpretive
> DO ... LOOP and so on.

I cannot agree. Actually, a standard system is not limited by the
standard word sets, and it may provide any additional facilities.

For a standard program two approaches (at the moment) are available to
implement interpretive DO LOOP:

- rely on immediacy and STATE-dependent definitions;
- implement a user-defined text interpreter.

And the main problem of implementing interpretive DO LOOP doesn't depend
on what of these approaches (or their alternatives) is chosen.

> The great strength of NDCS words is that they permit easy
> implementation of notations that are at present difficult.

Could you please provide an example: the *implementation* via NDCS words
of some particular notation that is at present *difficult*?

Your past example with DO is not suitable:

: DO NoInterp ; ndcs: ( -- ) s_do, 3 ;

| If you want an interpreted version of DO replace NOINTERP
| by the required code.

Since it's *not difficult* at present, and it can be achieved as following:

: do state @ if s_do, 3 exit then NoInterp ;

Or may be:

: dual ( xt-interp xt-compil "name" -- )
2r> : ]] state @ if [[ r> compile, ]] exit then [[
r> compile, ]] ; [[
;

' NoInterp [: s_do, 3 ;] dual do

If you want, replace NoInterp by the required code. But the problem of
interpretive DO LOOP in this "required code". Not in NDCS.

--
Ruvim

Re: Fix VFX FIND (was: POSTPONEing literals?)

<s7j068$v8d$1@dont-email.me>

  copy mid

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

  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: Fix VFX FIND (was: POSTPONEing literals?)
Date: Thu, 13 May 2021 13:48:38 +0300
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <s7j068$v8d$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org>
<2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me>
<s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me>
<60926f06.2412281@news.eternal-september.org>
<2021May5.134626@mips.complang.tuwien.ac.at>
<6092aa60.13264203@news.eternal-september.org> <s6umuu$1bd$1@dont-email.me>
<6093c11b.3105218@news.eternal-september.org> <s737aq$68j$1@dont-email.me>
<609aa2c8.1456671@news.eternal-september.org>
<55f55965-830a-4d0d-9e19-f380eca8a958n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 13 May 2021 10:48:40 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4a16db061bfb1fe3592890c0b77b0bc3";
logging-data="32013"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xFBbZzbz3uySjkWDJYfrz"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:rni6pUoxl4Cp0EG505jBbiU+LkA=
In-Reply-To: <55f55965-830a-4d0d-9e19-f380eca8a958n@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Thu, 13 May 2021 10:48 UTC

On 2021-05-12 22:01, Paul Liles wrote:
[...]

> COMPILE, on the other hand is very prescriptive and unforgiving.

This issue is addressed by the Recognizer API

The most recently discussed variant can be found at:
https://forth-standard.org/proposals/minimalistic-core-api-for-recognizers?hideDiff#reply-515

> I would propose changing the specification of COMPILE, to "perform the
> compilation semantics of xt" and leave it to implementers to decide
> what xts it can safely be fed, which will vary depending on the
> type of Forth that we have.

"compilation semantics of xt" is a nonsense.

Compilation semantics make sense for only named definitions (words).
Ditto interpretation semantics.

Please refer to 2.1 Definitions of terms
https://forth-standard.org/standard/notation#notation:terms

| compilation semantics:
| The behavior of a Forth definition when its name is
| encountered by the text interpreter in compilation state.

| interpretation semantics:
| The behavior of a Forth definition when its name is
| encountered by the text interpreter in interpretation state.

--
Ruvim

Re: Fix VFX FIND (was: POSTPONEing literals?)

<609cf7fe.7915093@news.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: step...@mpeforth.com (Stephen Pelc)
Newsgroups: comp.lang.forth
Subject: Re: Fix VFX FIND (was: POSTPONEing literals?)
Date: Thu, 13 May 2021 10:58:50 GMT
Organization: MPE
Lines: 55
Message-ID: <609cf7fe.7915093@news.eternal-september.org>
References: <s6a8o8$va3$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org> <2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me> <s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me> <s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me> <s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me> <60926f06.2412281@news.eternal-september.org> <2021May5.134626@mips.complang.tuwien.ac.at> <6092aa60.13264203@news.eternal-september.org> <s6umuu$1bd$1@dont-email.me> <6093c11b.3105218@news.eternal-september.org> <s737aq$68j$1@dont-email.me> <609aa2c8.1456671@news.eternal-september.org> <55f55965-830a-4d0d-9e19-f380eca8a958n@googlegroups.com>
Reply-To: stephen@mpeforth.com
Injection-Info: reader02.eternal-september.org; posting-host="81462c3d9e6b40bec15a307fd165bfa9";
logging-data="11526"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19B2uXD8Xuf8mwCsjlNX55T"
Cancel-Lock: sha1:pZTEgx7+kh9BL41kocnKv7t8vpE=
X-Newsreader: Forte Free Agent 1.21/32.243
 by: Stephen Pelc - Thu, 13 May 2021 10:58 UTC

On Wed, 12 May 2021 12:01:36 -0700 (PDT), Paul Liles
<pauldliles@btopenworld.com> wrote:

>All implementations of NDCS have the same sort of logic:
>- find an xt for a name
>- if immediate, execute it
>- if NDCS execute its compilation semantics
>- if neither, append its execution semantics.
>
>Exactly how this logic is distributed between FIND, the text interpreter,

>COMPILE, and possibly NAME>COMPILE is implementation dependent. It depends
>at least on what words can be found, on the dictionary structure and on
>what characteristics of a word (such as immediacy) you can derive from the
>execution token.

>And that's fine by me. One of the things I most like about the standard is
>that it is forgiving of different implementations.

And there is no portable way to determine whether a word is immediate,
let alone is an NDCS word.

>When it comes to implementing NDCS words, though, it does mean that it
>is very unlikely, maybe actually impossible, to define "NDCS," or
>whetever we call it in a way that will satisfy all the different flavours
>of Forth.

What's wrong with your prescription above?
"if NDCS execute its compilation semantics"

>That means we will have to rely on defining the standard in such a way
>that different implementations of NDCS words can work, leaving the
>underlying details to the implementation.

I fully expect NDCS, to need carnal knowledge of the underlying
Forth system.

>I'd expect, for example, that a VFX-type Forth would have NDCS, as
>a component of COMPILE, and POSTPONE, and that a Gforth-type Forth
>would have something similar as a component of FIND and POSTPONE
>and as a return value of NAME>COMPILE.

COMPILE, may not parse source text or have additional stack effects.
Thus it cannot be used for control flow words, S" and so on.

Thank you for your comments.

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
web: http://www.mpeforth.com - free VFX Forth downloads

Re: POSTPONEing literals?

<s7j8b5$1uqc$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: POSTPONEing literals?
Date: Thu, 13 May 2021 23:07:49 +1000
Organization: Aioe.org NNTP Server
Lines: 117
Message-ID: <s7j8b5$1uqc$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <2021May9.172106@mips.complang.tuwien.ac.at>
<s7a94j$6ii$1@gioia.aioe.org> <2021May10.180918@mips.complang.tuwien.ac.at>
<s7df2c$1nas$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 13 May 2021 13:07 UTC

On 11/05/2021 20:51, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>>On 11/05/2021 02:09, Anton Ertl wrote:
>>> dxforth <dxforth@gmail.com> writes:
>>>>What hasn't changed is the classic behaviour that executing
>>>>COMPILE when STATE=0 will crash the interpreter due to IP having been
>>>>advanced.
>>>
>>> This has nothing to do with STATE; you identify the dependency
>>> correctly: IP. Here's an example how COMPILE can run when STATE=0:
>>>
>>> \ First, define COMPILE, and show STATE when it runs:
>>> : compile state ? r> dup cell+ >r @ , ;
>>>
>>> : foo compile . ;
>>> : bar [ foo ] ; \ prints "0" (output of COMPILE)
>>> 1 bar \ prints "1"
>>>
>>> Tested with gforth-itc 0.7.9_20210415. As you can see, running
>>> COMPILE when STATE=0 works.
>>
>>AFAIK Forth-83 didn't require that example to work. Same for
>>ANS and POSTPONE.
>
> I guess that changing the goalposts is an admission that the statement
> "executing COMPILE when STATE=0 will crash the interpreter due to IP
> having been advanced." is wrong.
>
> Let's consider the new goalposts:
>
> 1) Return-address manipulation is non-standard (I think also in
> Forth-83). But let's assume the system-defined COMPILE rather than
> the COMPILE defined above.
>
> 2) Forth-83
>
> COMPILE is marked with the C attribute in Forth-83. In Section 11.4,
> Forth-83 states:
>
> | C The word may only be used during compilation of a colon
> | definition.
>
> It's not clear what "use" means here. Does it mean the compilation of
> COMPILE during the definition of FOO? Does it mean the running of
> COMPILE during the definition of BAR? Does it mean the result of the
> COMPILE when running BAR in the final line of the example? I guess
> that it's not the latter, because then COMPILE would be pretty
> unusable.

Go to the definitions:

interpretation semantics:
The behavior of a Forth definition when its name is encountered
by the text interpreter in interpretation state.

6.1.2250 STATE
... STATE is true when in compilation state, false otherwise. ...

So when ANS says 'interpretation semantics undefined' in POSTPONE it
meant STATE=0 - irrespective of whether POSTPONE is being executed
in a definition.

This restriction almost certainly comes from 79/83-COMPILE and the
most popular forth of the day Fig-Forth:

SCR # 41
0 ( COMPILE, SMUDGE, HEX, DECIMAL WFR-79APR20 )
1
2 : COMPILE ( COMPILE THE EXECUTION ADDRESS FOLLOWING *)
3 ?COMP R> DUP 2+ >R @ , ;

The ?COMP prevented COMPILE being executed outside a definition which
would otherwise result in a system crash, but also had the side-effect
of preventing execution when STATE=0. If the goalposts have since
moved, it wasn't the standards' doing.

>
> The other unclear thing is what "during compilation of a colon
> definition" means. My take is that FOO is run during the compilation
> of BAR, so the definition of BAR is Forth-83-conforming in my book.
> Fans of ?COMP will probably take a different position, claiming that
> "during compilation" means STATE=-1, and ignoring the "of a colon
> definition" part.
>
> 3) We have discussed POSTPONE repeatedly over the last
> quarter-century, and I have established repeatedly that according to
> the text of Forth-94 and Forth-2012
>
> : foo postpone . ;
> : bar [ foo ] ;
> 1 bar \ prints "1"
>
> conforms to these standards.

Not by my interpretation above.

>
>>Is there a demonstrated need that it should
>>work that would justify amending or clarifying ANS' ruling?
>
> There is no need to amend or clarify. The text of the standard is
> clear. If anyone wants to change it in the direction of disallowing
> to append something to the current definition when STATE=0, they have
> to propose it and should give a good reason for such a change. I
> demonstrated above that basing POSTPONE on COMPILE is not such a
> reason.
>
>>Change in my case would mean removing ?COMP from COMPILE. The
>>former hasn't proven an issue thus far. I'd like to know what
>>I was getting in return for removing compiler security.
>
> You get at least two bytes. And ?COMP is not compiler security.

Sure it is. Removing ?COMP from COMPILE would mean explicitly
inserting it into IF AHEAD UNTIL AGAIN etc which costs more than
two bytes. COMPILE is left unprotected and it's cost me memory.
If that's all I'm being offered, Fig has the better deal.

Re: Alternative to FIND

<d0b9a46e-4775-4dd1-814a-9a124bc86ddbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:c709:: with SMTP id w9mr40616803qvi.37.1620916051418; Thu, 13 May 2021 07:27:31 -0700 (PDT)
X-Received: by 2002:a0c:d80a:: with SMTP id h10mr40399281qvj.25.1620916051134; Thu, 13 May 2021 07:27:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 13 May 2021 07:27:30 -0700 (PDT)
In-Reply-To: <s7it91$5mb$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:5d6c:6cda:a2b8:4716:34b; posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:5d6c:6cda:a2b8:4716:34b
References: <s6a8o8$va3$1@gioia.aioe.org> <s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me> <s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me> <s6nvtm$149e$1@gioia.aioe.org> <s6odjp$2pk$1@dont-email.me> <s6qi25$bjs$1@gioia.aioe.org> <s6qmbs$ki6$1@dont-email.me> <s6u558$76l$1@gioia.aioe.org> <2021May5.163707@mips.complang.tuwien.ac.at> <s6vhvp$gqg$1@gioia.aioe.org> <s701p0$tlf$1@dont-email.me> <s70and$1tle$1@gioia.aioe.org> <c4c77b94-3598-4ae5-a74a-b6177a9edc85n@googlegroups.com> <s70t6p$tql$1@dont-email.me> <s70uis$94c$1@dont-email.me> <1b2fbcdd-68e9-4e3e-995b-51f2f7d2bdf7n@googlegroups.com> <s7buca$r8e$1@dont-email.me> <721974e8-0e94-4c4e-b2c8-52c724ceeb13n@googlegroups.com> <s7e2ug$c08$1@dont-email.me> <0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com> <s7g62e$15c$1@dont-email.me> <3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com> <s7gevk$dlg$1@dont-email.me> <c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com> <s7it91$5mb$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d0b9a46e-4775-4dd1-814a-9a124bc86ddbn@googlegroups.com>
Subject: Re: Alternative to FIND
From: peter.m....@gmail.com (P Falth)
Injection-Date: Thu, 13 May 2021 14:27:31 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 97
 by: P Falth - Thu, 13 May 2021 14:27 UTC

On Thursday, 13 May 2021 at 11:58:59 UTC+2, Ruvim wrote:
> On 2021-05-12 15:12, P Falth wrote:
> > On Wednesday, 12 May 2021 at 13:42:46 UTC+2, Ruvim wrote:
> >> On 2021-05-12 13:58, P Falth wrote:
> [...]
> >>> I have looked thru all my sources. FIND is never used. in other peoples
> >>> sources I have I see it used some time to define [DEFINED] . For
> >>> this purpose my state dump find will work just fine.
> >>> This also means that I can test a state-smart find without breaking my system!
> >>>
> >>> But what will I actually gain from it?
> >>>
> >> As an implementer — nothing direct gain.
> >>
> >> The users of your system can use some portable libraries and programs
> >> that rely on FIND. Or the Forth users in general can choose your system
> >> in more cases.
> >>
> >> For example, at the moment I cannot use your system, and one of the
> >> issues is that a user-defined text interpreter doesn't work.
> >
> > There is another problem waiting for a user defined text interpreter and that
> > is locals. They will not be found by FIND ( or find-name, search-wordlist etc)
> > and they do not have an xt. They are stored in a specific table that is setup
> > and destroyed at : and ;
> As Anton pointed out, it was discussed.
>
> My conclusion is that FIND is not obligated to find locals. And I'm not
> convinced that FIND is allowed to traverse anything beyond the search order.
>
> So the problem with locals in a user-defined text interpreter is not
> about FIND, and this problem can be addressed to the Locals word set.
> Also, Recognizer API should provide a recognizer for locals.
>
> As a workaround, locals can be implemented in a portable way, but of
> course not so efficient.
>
> I personally barely use locals.

So on this we agree!

Neither I am a great user of locals. But when I implement something
I try to do it in a good way.

What I have also is a local buffer, working like BUFFER: but assigning
memory from the local stack (return stack). This is accessed with
the name and @/!. Very useful when doing interfaces to Windows or
Linux systemcalls. Individual fields can be accessed via a structure

Based on our discussions here I have now modified FIND to be state-smart.
It was not to complicated. Here is the code:

\ state smart version of find for lxf
\ word types in lxf and flag values
\ flag meaning
\ 0 normal user defined word
\ 1 compiler word, IF etc
\ 2 word with a code generator
\ 4 created word, constant, variable etc
\ 8 immediate word
\ 16 macro, source string to be evaluated

\ ht>xtf ( ht -- xtr xtc flag ) \ from the NT (ht in lxf) get xts and flag
\ xtr = xt for intrepretation action
\ xtc = xt for compilation action

\ : findheader ( c-addr u -- c-addr u 0 | ht )

: f-int ( xtr xtc flag -- xt -1|1 ) \ get the xt and flag while state is 0
9 and if nip 1 else drop -1 then ;
: f-comp ( xtr xtc flag -- xt -1|1 ) \ get the xt and flag while state is -1
27 and if nip 1 else drop -1 then ;
: find ( caddr -- caddr 0 | xt f )
count findheader dup 0= if 2drop 1- 0 exit then
ht>xtf
state @ if f-comp exit then
f-int ;

I also changed all compile-only words to be immediate and
allow ticking instead of printing an error message in interpretation state

BR
Peter

> --
> Ruvim

Re: POSTPONEing literals?

<s7jjau$llu$1@dont-email.me>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 13 May 2021 19:15:25 +0300
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <s7jjau$llu$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org>
<2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <2021May9.172106@mips.complang.tuwien.ac.at>
<s7a94j$6ii$1@gioia.aioe.org> <2021May10.180918@mips.complang.tuwien.ac.at>
<s7df2c$1nas$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at>
<s7j8b5$1uqc$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 May 2021 16:15:26 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4a16db061bfb1fe3592890c0b77b0bc3";
logging-data="22206"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iAFWCjtEz7GNcYh/dLKbb"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:n1Z+DcvVeo22+nINz9AOK9DYH7c=
In-Reply-To: <s7j8b5$1uqc$1@gioia.aioe.org>
Content-Language: en-US
 by: Ruvim - Thu, 13 May 2021 16:15 UTC

On 2021-05-13 16:07, dxforth wrote:

> Go to the definitions:
>
>  interpretation semantics:
>    The behavior of a Forth definition when its name is encountered
>    by the text interpreter in interpretation state.
>
>  6.1.2250 STATE
>    ... STATE is true when in compilation state, false otherwise. ...
>
> So when ANS says 'interpretation semantics undefined' in POSTPONE it
> meant STATE=0 - irrespective of whether POSTPONE is being executed
> in a definition.

It looks like you miss the part "name is encountered by the text
interpreter"

Interpretation semantics are not about "a name is being execute", but
about "a name is being encountered".

By your argument, the following definition of "within" [1]:

: within ( test low high -- flag ) over - >r - r> u< ;

cannot work in interpretation state:

1 1 5 within . \ prints -1

since interpretation semantics for ">r" are undefined.

But that's wrong (since this "within" should work in interpretation
state). Then your argument is also wrong.

[1] This example at forth-standard.org
https://forth-standard.org/standard/core/WITHIN#contribution-127

--
Ruvim

Re: Alternative to FIND

<2021May13.181250@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Alternative to FIND
Date: Thu, 13 May 2021 16:12:50 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 18
Message-ID: <2021May13.181250@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <s7buca$r8e$1@dont-email.me> <721974e8-0e94-4c4e-b2c8-52c724ceeb13n@googlegroups.com> <s7e2ug$c08$1@dont-email.me> <0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com> <s7g62e$15c$1@dont-email.me> <3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com> <s7gevk$dlg$1@dont-email.me> <c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com> <s7it91$5mb$1@dont-email.me> <d0b9a46e-4775-4dd1-814a-9a124bc86ddbn@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="9b6fdafab5a0ed867dc02613f2ce9d52";
logging-data="22531"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18c4n8lJFpQJeTQ3TbEgp26"
Cancel-Lock: sha1:f9Vxr6zfM8MV4kqgy1cUdEBT2+4=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 13 May 2021 16:12 UTC

P Falth <peter.m.falth@gmail.com> writes:
>Based on our discussions here I have now modified FIND to be state-smart.

It will be interesting to test this.

>I also changed all compile-only words to be immediate and
>allow ticking instead of printing an error message in interpretation state

We also made this change in the development version of Gforth several
years ago. You still get a warning when you text-interpret it in
interpret state or when you tick it.

- 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 2020: https://euro.theforth.net/2020

Re: Alternative to FIND

<d8274580-9baf-4ae4-be61-c3f16ad4619en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:daa:: with SMTP id h10mr41536071qvh.42.1620924160996;
Thu, 13 May 2021 09:42:40 -0700 (PDT)
X-Received: by 2002:ad4:4e94:: with SMTP id dy20mr41802440qvb.50.1620924160792;
Thu, 13 May 2021 09:42:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!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: Thu, 13 May 2021 09:42:40 -0700 (PDT)
In-Reply-To: <2021May13.181250@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:5d6c:6cda:a2b8:4716:34b;
posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:5d6c:6cda:a2b8:4716:34b
References: <s6a8o8$va3$1@gioia.aioe.org> <s7buca$r8e$1@dont-email.me>
<721974e8-0e94-4c4e-b2c8-52c724ceeb13n@googlegroups.com> <s7e2ug$c08$1@dont-email.me>
<0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com> <s7g62e$15c$1@dont-email.me>
<3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com> <s7gevk$dlg$1@dont-email.me>
<c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com> <s7it91$5mb$1@dont-email.me>
<d0b9a46e-4775-4dd1-814a-9a124bc86ddbn@googlegroups.com> <2021May13.181250@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d8274580-9baf-4ae4-be61-c3f16ad4619en@googlegroups.com>
Subject: Re: Alternative to FIND
From: peter.m....@gmail.com (P Falth)
Injection-Date: Thu, 13 May 2021 16:42:40 +0000
Content-Type: text/plain; charset="UTF-8"
 by: P Falth - Thu, 13 May 2021 16:42 UTC

On Thursday, 13 May 2021 at 18:18:50 UTC+2, Anton Ertl wrote:
> P Falth <peter....@gmail.com> writes:
> >Based on our discussions here I have now modified FIND to be state-smart.
> It will be interesting to test this.

I will zip it up with some comments and send it to you.
Maybe you can put it on your site for distribution as with the old.
I have a mail address to you from about 16 years ago, can that still be valid?

> >I also changed all compile-only words to be immediate and
> >allow ticking instead of printing an error message in interpretation state
> We also made this change in the development version of Gforth several
> years ago. You still get a warning when you text-interpret it in
> interpret state or when you tick it.

Yes I have seen this while testing gforth and found the warnings a bit irritating.
I also didn't like the blue status line in the bottom row. Can it be turned of?
Some times it bleeds to the lines above when it scrolls

BR
Peter

> - 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 2020: https://euro.theforth.net/2020

Re: Alternative to FIND

<2021May13.194141@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Alternative to FIND
Date: Thu, 13 May 2021 17:41:41 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 41
Message-ID: <2021May13.194141@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <s7e2ug$c08$1@dont-email.me> <0c2022f8-3599-4799-9953-f1a8567118fcn@googlegroups.com> <s7g62e$15c$1@dont-email.me> <3f4c7701-20b6-4bfd-b99a-db7ce0369a30n@googlegroups.com> <s7gevk$dlg$1@dont-email.me> <c3ef667e-297f-4c29-ba2e-50706f3659f1n@googlegroups.com> <s7it91$5mb$1@dont-email.me> <d0b9a46e-4775-4dd1-814a-9a124bc86ddbn@googlegroups.com> <2021May13.181250@mips.complang.tuwien.ac.at> <d8274580-9baf-4ae4-be61-c3f16ad4619en@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="9b6fdafab5a0ed867dc02613f2ce9d52";
logging-data="3597"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18N2RrcNJf1LkXbbFke8wWM"
Cancel-Lock: sha1:2RN94pk0q6eX1lAW+YT4eORXBsc=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 13 May 2021 17:41 UTC

P Falth <peter.m.falth@gmail.com> writes:
>On Thursday, 13 May 2021 at 18:18:50 UTC+2, Anton Ertl wrote:
>> P Falth <peter....@gmail.com> writes:
>> >Based on our discussions here I have now modified FIND to be state-smart.
>> It will be interesting to test this.
>
>I will zip it up with some comments and send it to you.
>Maybe you can put it on your site for distribution as with the old.

I'll be happy to.

>I have a mail address to you from about 16 years ago, can that still be valid?

Sure, and the mail address in this posting is also valid.

>> >I also changed all compile-only words to be immediate and
>> >allow ticking instead of printing an error message in interpretation state
>> We also made this change in the development version of Gforth several
>> years ago. You still get a warning when you text-interpret it in
>> interpret state or when you tick it.
>
>Yes I have seen this while testing gforth and found the warnings a bit irritating.

You can turn (all) warnings off with

warnings off

>I also didn't like the blue status line in the bottom row. Can it be turned of?

-status

>Some times it bleeds to the lines above when it scrolls

You could try sending us a bug report with more details.

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<s7k8l5$qav$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: POSTPONEing literals?
Date: Thu, 13 May 2021 17:19:16 -0500
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <s7k8l5$qav$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org>
<2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <2021May9.172106@mips.complang.tuwien.ac.at>
<s7a94j$6ii$1@gioia.aioe.org> <2021May10.180918@mips.complang.tuwien.ac.at>
<s7df2c$1nas$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at>
<s7fv9c$p2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 May 2021 22:19:17 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4da0ea5b12fb1d308648ae5745513990";
logging-data="26975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/S0Q/M8glla+6bbHZlKuWE"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.0
Cancel-Lock: sha1:hDGm/LFju4nIpPqw8hXJzkeQFLc=
In-Reply-To: <s7fv9c$p2$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Thu, 13 May 2021 22:19 UTC

On 5/12/21 2:14 AM, Ruvim wrote:
> On 2021-05-11 13:51, Anton Ertl wrote:
> [...]
>> 3) We have discussed POSTPONE repeatedly over the last
>> quarter-century, and I have established repeatedly that according to
>> the text of Forth-94 and Forth-2012
>>
>> : foo postpone . ;
>> : bar [ foo ] ;
>> 1 bar           \ prints "1"
>>
>> conforms to these standards.
>
> According to the only wording in the specification for POSTPONE this
> code conforms the standard, and it should print "1".
> ...

Is there a *standard* way of detecting an incomplete definition when in
interpretation state?

Krishna

Re: POSTPONEing literals?

<s7ksr8$114k$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: POSTPONEing literals?
Date: Fri, 14 May 2021 14:03:53 +1000
Organization: Aioe.org NNTP Server
Lines: 42
Message-ID: <s7ksr8$114k$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org>
<2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <2021May9.172106@mips.complang.tuwien.ac.at>
<s7a94j$6ii$1@gioia.aioe.org> <2021May10.180918@mips.complang.tuwien.ac.at>
<s7df2c$1nas$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at>
<s7j8b5$1uqc$1@gioia.aioe.org> <s7jjau$llu$1@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Fri, 14 May 2021 04:03 UTC

On 14/05/2021 02:15, Ruvim wrote:
> On 2021-05-13 16:07, dxforth wrote:
>
>> Go to the definitions:
>>
>>  interpretation semantics:
>>    The behavior of a Forth definition when its name is encountered
>>    by the text interpreter in interpretation state.
>>
>>  6.1.2250 STATE
>>    ... STATE is true when in compilation state, false otherwise. ...
>>
>> So when ANS says 'interpretation semantics undefined' in POSTPONE it
>> meant STATE=0 - irrespective of whether POSTPONE is being executed
>> in a definition.
>
> It looks like you miss the part "name is encountered by the text
> interpreter"
>
> Interpretation semantics are not about "a name is being execute", but
> about "a name is being encountered".
>
> By your argument, the following definition of "within" [1]:
>
> : within ( test low high -- flag ) over - >r - r> u< ;
>
> cannot work in interpretation state:
>
> 1 1 5 within . \ prints -1
>
> since interpretation semantics for ">r" are undefined.

I can't ignore history and neither did ANS. By ANS' own commentary
in A.6.1.2033, POSTPONE is little more than a combination of COMPILE
and [COMPILE]. Any restrictions on the standard use of POSTPONE is
a consequence of the use of those historic words. To use the
wording of ANS to suggest WITHIN is illegal, or alternatively, to
extrapolate behaviours in ways that break historical precedence,
can only result in fragmentation and chaos. OTOH if it can be
demonstrated change to an existing ruling benefits everyone, that's
a different story and one that even I may be interested in if it
proves to be true.

Re: POSTPONEing literals?

<2021May14.123322@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Fri, 14 May 2021 10:33:22 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 36
Message-ID: <2021May14.123322@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me> <s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me> <s6nvtm$149e$1@gioia.aioe.org> <2021May9.172106@mips.complang.tuwien.ac.at> <s7a94j$6ii$1@gioia.aioe.org> <2021May10.180918@mips.complang.tuwien.ac.at> <s7df2c$1nas$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at> <s7fv9c$p2$1@dont-email.me> <s7k8l5$qav$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="5d5f7c2fd86717a462d647ead1d1489d";
logging-data="17175"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZW8q6XIy2gsOKX9iC4BeH"
Cancel-Lock: sha1:astx3MuapE+/dvV/v5XTSSXRuwE=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 14 May 2021 10:33 UTC

Krishna Myneni <krishna.myneni@ccreweb.org> writes:
>On 5/12/21 2:14 AM, Ruvim wrote:
>> On 2021-05-11 13:51, Anton Ertl wrote:
>> [...]
>>> 3) We have discussed POSTPONE repeatedly over the last
>>> quarter-century, and I have established repeatedly that according to
>>> the text of Forth-94 and Forth-2012
>>>
>>> : foo postpone . ;
>>> : bar [ foo ] ;
>>> 1 bar           \ prints "1"
>>>
>>> conforms to these standards.
>>
>> According to the only wording in the specification for POSTPONE this
>> code conforms the standard, and it should print "1".
>> ...
>
>Is there a *standard* way of detecting an incomplete definition when in
>interpretation state?

A standard program cannot detect whether a definition is incomplete or
can be continued, irrespective of state.

] . [ \ non-standard
: foo [ 1 , ] . ; \ non-standard
: comp-. postpone . ; immediate \ standard
: bar1 comp-. ; \ standard
: bar2 [ comp-. ] ; \ standard

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<2021May14.124013@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Fri, 14 May 2021 10:40:13 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 132
Message-ID: <2021May14.124013@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <2021Apr29.105420@mips.complang.tuwien.ac.at> <s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me> <s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me> <s6nvtm$149e$1@gioia.aioe.org> <2021May9.172106@mips.complang.tuwien.ac.at> <s7a94j$6ii$1@gioia.aioe.org> <2021May10.180918@mips.complang.tuwien.ac.at> <s7df2c$1nas$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at> <s7j8b5$1uqc$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="5d5f7c2fd86717a462d647ead1d1489d";
logging-data="21090"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VAv+99G2tCqx1G8/K5Cdg"
Cancel-Lock: sha1:lEHRfxasV2c7gY7ePeLwNDG8Duk=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 14 May 2021 10:40 UTC

dxforth <dxforth@gmail.com> writes:
>On 11/05/2021 20:51, Anton Ertl wrote:
>> dxforth <dxforth@gmail.com> writes:
>>>On 11/05/2021 02:09, Anton Ertl wrote:
>>>> dxforth <dxforth@gmail.com> writes:
>>>>>What hasn't changed is the classic behaviour that executing
>>>>>COMPILE when STATE=0 will crash the interpreter due to IP having been
>>>>>advanced.
>>>>
>>>> This has nothing to do with STATE; you identify the dependency
>>>> correctly: IP. Here's an example how COMPILE can run when STATE=0:
>>>>
>>>> \ First, define COMPILE, and show STATE when it runs:
>>>> : compile state ? r> dup cell+ >r @ , ;
>>>>
>>>> : foo compile . ;
>>>> : bar [ foo ] ; \ prints "0" (output of COMPILE)
>>>> 1 bar \ prints "1"
>>>>
>>>> Tested with gforth-itc 0.7.9_20210415. As you can see, running
>>>> COMPILE when STATE=0 works.
>>>
>>>AFAIK Forth-83 didn't require that example to work. Same for
>>>ANS and POSTPONE.
>>
>> I guess that changing the goalposts is an admission that the statement
>> "executing COMPILE when STATE=0 will crash the interpreter due to IP
>> having been advanced." is wrong.
>>
>> Let's consider the new goalposts:
>>
>> 1) Return-address manipulation is non-standard (I think also in
>> Forth-83). But let's assume the system-defined COMPILE rather than
>> the COMPILE defined above.
>>
>> 2) Forth-83
>>
>> COMPILE is marked with the C attribute in Forth-83. In Section 11.4,
>> Forth-83 states:
>>
>> | C The word may only be used during compilation of a colon
>> | definition.
>>
>> It's not clear what "use" means here. Does it mean the compilation of
>> COMPILE during the definition of FOO? Does it mean the running of
>> COMPILE during the definition of BAR? Does it mean the result of the
>> COMPILE when running BAR in the final line of the example? I guess
>> that it's not the latter, because then COMPILE would be pretty
>> unusable.
>
>Go to the definitions:
>
> interpretation semantics:
> The behavior of a Forth definition when its name is encountered
> by the text interpreter in interpretation state.
>
> 6.1.2250 STATE
> ... STATE is true when in compilation state, false otherwise. ...
>
>So when ANS says 'interpretation semantics undefined' in POSTPONE it
>meant STATE=0

It's unclear to me why you discuss this Forth-94 stuff as answer to my
discussion of Forth-83, but anyway, here we go:

No, it means that text-interpreting POSTPONE in interpret state is
undefined. I.e.:

: foo [ postpone . ] ;

is non-standard, nothing more.

>This restriction almost certainly comes from 79/83-COMPILE and the
>most popular forth of the day Fig-Forth:

Actually the "Implementation semantics is undefined" specification
reflects the practice of cmForth to put words like IF into the
COMPILER vocabulary, but not in the FORTH wordlist; so IF is only
found by the text interpreter in interpret state (but it can still be
run in interpret state).

Interestingly, cmForth puts COMPILE in the FORTH wordlist, not in the
compiler wordlist, even though text-interpreting COMPILE in interpret
state is guaranteed to have unintended results. The Forth-94
committee apparently thought that it is a good idea to undefine the
interpretation semantics of POSTPONE, even though POSTPONE does not
have this problem of COMPILE.

> SCR # 41
> 0 ( COMPILE, SMUDGE, HEX, DECIMAL WFR-79APR20 )
> 1
> 2 : COMPILE ( COMPILE THE EXECUTION ADDRESS FOLLOWING *)
> 3 ?COMP R> DUP 2+ >R @ , ;
>
>The ?COMP prevented COMPILE being executed outside a definition

No, it does not, because in fig-Forth ?COMP only tests STATE. You can
write

] COMPILE + [ \ without enclosing colon definition

and the ?COMP will not prevent it.

>> You get at least two bytes. And ?COMP is not compiler security.
>
>Sure it is. Removing ?COMP from COMPILE would mean explicitly
>inserting it into IF AHEAD UNTIL AGAIN etc which costs more than
>two bytes.

?COMP in IF AHEAD UNTIL AGAIN is not compiler security, either. If
you want to prevent these words from being executed outside colon
definitions, you need a way to identify whether you are inside a colon
definition; STATE is not that way, and has not been ever since [ and ]
were introduced.

But is such a check practically useful? It seems that in Forth,
Inc. experience it's not:

SwiftForth i386-Linux 3.11.0 23-Feb-2021
if ok
..s
134761494 <-Top ok
then ok
..s
<-Top ok

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<609e68c5$0$29327$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
Subject: Re: POSTPONEing literals?
References: <s6a8o8$va3$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at> <s7j8b5$1uqc$1@gioia.aioe.org> <2021May14.124013@mips.complang.tuwien.ac.at>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 14 May 2021 12:10:45 GMT
Lines: 56
Message-ID: <609e68c5$0$29327$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: cbf29b76.news.xs4all.nl
X-Trace: G=n2zzVVZi,C=U2FsdGVkX1/NGaP3iL5Q02OSE5x2IT6FHT9wvmtBrjVM/ItguittFUSoAPvt4kZnUdS9HRJ7uJ8CE46pTwejjfnMKBURcTmpo55GLa/CQoS/AEw4M4Pvj0ZpQRrjkXp8
X-Complaints-To: abuse@xs4all.nl
 by: none - Fri, 14 May 2021 12:10 UTC

In article <2021May14.124013@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
<SNIP>
>
>?COMP in IF AHEAD UNTIL AGAIN is not compiler security, either. If
>you want to prevent these words from being executed outside colon
>definitions, you need a way to identify whether you are inside a colon
>definition; STATE is not that way, and has not been ever since [ and ]
>were introduced.
>
>But is such a check practically useful? It seems that in Forth,
>Inc. experience it's not:
>
>SwiftForth i386-Linux 3.11.0 23-Feb-2021
>if ok
>.s
>134761494 <-Top ok
>then ok
>.s
><-Top ok

Or in ciforth
Note that you have to load the electives, otherwise
this feature is not available. (-e option).

"
lina64 -e
.....
You should have received a copy of the GNU General Public
....
TASK : ISN'T UNIQUE

TYPE "WANT AUTOLOAD" for automatic loading.
S[ 1 ] OK 12 IF

S[ 12 37766592 0 37766600 2 ] OK "aap" TYPE

S[ 12 37766592 0 37766600 2 ] OK ELSE

S[ 12 37766592 0 37766680 2 ] OK "NOOT " TYPE

S[ 12 37766592 0 37766680 2 ] OK THEN
aap
S[ ] OK
"
It serves no purpose to put roadblocks in the way of a useful
extension.

>- anton

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: POSTPONEing literals?

<s7lr4o$oo3$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: POSTPONEing literals?
Date: Fri, 14 May 2021 07:40:54 -0500
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <s7lr4o$oo3$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org> <s6e45l$lpa$1@dont-email.me>
<s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
<s6ifhb$139$1@gioia.aioe.org> <s6liqg$ia6$1@dont-email.me>
<s6nvtm$149e$1@gioia.aioe.org> <2021May9.172106@mips.complang.tuwien.ac.at>
<s7a94j$6ii$1@gioia.aioe.org> <2021May10.180918@mips.complang.tuwien.ac.at>
<s7df2c$1nas$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at>
<s7fv9c$p2$1@dont-email.me> <s7k8l5$qav$1@dont-email.me>
<2021May14.123322@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 14 May 2021 12:40:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4da0ea5b12fb1d308648ae5745513990";
logging-data="25347"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+u63QL1Z/p0Gh3Az38ktn0"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.0
Cancel-Lock: sha1:ymkE27vPWjoCcsRZTfqHEUwyzew=
In-Reply-To: <2021May14.123322@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Krishna Myneni - Fri, 14 May 2021 12:40 UTC

On 5/14/21 5:33 AM, Anton Ertl wrote:
> Krishna Myneni <krishna.myneni@ccreweb.org> writes:
>> On 5/12/21 2:14 AM, Ruvim wrote:
>>> On 2021-05-11 13:51, Anton Ertl wrote:
>>> [...]
>>>> 3) We have discussed POSTPONE repeatedly over the last
>>>> quarter-century, and I have established repeatedly that according to
>>>> the text of Forth-94 and Forth-2012
>>>>
>>>> : foo postpone . ;
>>>> : bar [ foo ] ;
>>>> 1 bar           \ prints "1"
>>>>
>>>> conforms to these standards.
>>>
>>> According to the only wording in the specification for POSTPONE this
>>> code conforms the standard, and it should print "1".
>>> ...
>>
>> Is there a *standard* way of detecting an incomplete definition when in
>> interpretation state?
>
> A standard program cannot detect whether a definition is incomplete or
> can be continued, irrespective of state.
>
> ] . [ \ non-standard
> : foo [ 1 , ] . ; \ non-standard
> : comp-. postpone . ; immediate \ standard
> : bar1 comp-. ; \ standard
> : bar2 [ comp-. ] ; \ standard
>

If the original example is standard, namely,

: foo postpone . ;
: bar [ foo ] ;

with the behavior, "1 bar" prints "1", then perhaps it is possible to
write a word in standard code which can tell whether or not a definition
is in progress, and may be continued.

FOO is aware of an incomplete definition since FOO is able to append the
execution semantics of "." to the incomplete definition, even when FOO
is executed in interpretation state.

There are two other ways, in Gforth, to obtain the same behavior for BAR.

1.

: foo postpone . ; immediate
: bar foo ;

2.

: foo . ;
: bar [ ' foo compile, ] ;

Both will give behavior that "1 bar" prints "1". I believe there is no
dispute that method 1 is consistent with most people's understanding of
the Forth standard.

For both "POSTPONE" and "COMPILE," the standard says,

"interpretation semantics for this word are undefined"

How do we reconcile the above statement with using POSTPONE and COMPILE,
in interpretation state? Does the term, "interpretation semantics",
then, not apply when one opens a definition and then enters
interpretation state?

I note that in Gforth (and kForth as well), it is possible to write,

' foo compile,

when no definition is in progress. But, it has no useful property within
the standard.

Krishna

Re: POSTPONEing literals?

<2021May14.190815@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Fri, 14 May 2021 17:08:15 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 47
Message-ID: <2021May14.190815@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <2021May11.125143@mips.complang.tuwien.ac.at> <s7j8b5$1uqc$1@gioia.aioe.org> <2021May14.124013@mips.complang.tuwien.ac.at> <609e68c5$0$29327$e4fe514c@news.xs4all.nl>
Injection-Info: reader02.eternal-september.org; posting-host="5d5f7c2fd86717a462d647ead1d1489d";
logging-data="27673"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yT5viM7nDp/oD6Bl706rT"
Cancel-Lock: sha1:1u/9lfMrLGNUv/e9BsfdVUYijfc=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 14 May 2021 17:08 UTC

albert@cherry.(none) (albert) writes:
>In article <2021May14.124013@mips.complang.tuwien.ac.at>,
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
><SNIP>
>>
>>?COMP in IF AHEAD UNTIL AGAIN is not compiler security, either. If
>>you want to prevent these words from being executed outside colon
>>definitions, you need a way to identify whether you are inside a colon
>>definition; STATE is not that way, and has not been ever since [ and ]
>>were introduced.
>>
>>But is such a check practically useful? It seems that in Forth,
>>Inc. experience it's not:
>>
>>SwiftForth i386-Linux 3.11.0 23-Feb-2021
>>if ok
>>.s
>>134761494 <-Top ok
>>then ok
>>.s
>><-Top ok
>
>Or in ciforth
>Note that you have to load the electives, otherwise
>this feature is not available. (-e option).

[example of an [if]-like if]

Note that SwiftForth does not tack any particular feature on
interpreted IF and THEN. As far as I can tell, it just performs the
compilation semantics when interpreting IF and THEN:

SwiftForth i386-Linux 3.11.0 23-Feb-2021
cr 1 if 2 . then .s
2
1 <-Top ok
drop ok
cr 0 if 2 . then .s
2
0 <-Top ok

- 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 2020: https://euro.theforth.net/2020

Pages:123456789
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor