Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Innovation distinguishes between a leader and a follower. -- Steve Jobs (1955-2011)


devel / comp.lang.forth / Re: Resolving multiple THENs

SubjectAuthor
* Resolving multiple THENsdxf
`* Re: Resolving multiple THENsAnton Ertl
 `* Re: Resolving multiple THENsdxf
  `* Re: Resolving multiple THENsAnton Ertl
   `* Re: Resolving multiple THENsdxf
    +- Re: Resolving multiple THENsnone
    `* Re: Resolving multiple THENsAnton Ertl
     `- Re: Resolving multiple THENsdxf

1
Resolving multiple THENs

<uo2gj6$qrn9$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25954&group=comp.lang.forth#25954

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Resolving multiple THENs
Date: Mon, 15 Jan 2024 16:41:59 +1100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uo2gj6$qrn9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 15 Jan 2024 05:41:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c1619c7fc4c075b44dc2e0800a4e3db1";
logging-data="880361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uLdi8yklAzW4zZ7GjvsqT"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:YnxOM0LZ8c2c4Yr+C8muyJXRRc0=
Content-Language: en-GB
 by: dxf - Mon, 15 Jan 2024 05:41 UTC

Forth has never really tackled resolving arbitrary multiple THENs - other than
in the limited context of CASE. That seems a pity.

COND
IF ...
IF ...
IF ...
CONT

COND
IF ... ELSE ...
IF ... ELSE ...
IF ... ELSE ...
CONT

COND
BEGIN
WHILE ...
WHILE ...
WHILE ...
AGAIN
CONT

Re: Resolving multiple THENs

<2024Jan15.090126@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25955&group=comp.lang.forth#25955

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Resolving multiple THENs
Date: Mon, 15 Jan 2024 08:01:26 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 43
Message-ID: <2024Jan15.090126@mips.complang.tuwien.ac.at>
References: <uo2gj6$qrn9$1@dont-email.me>
Injection-Info: dont-email.me; posting-host="7db9b28d36ef55f3b67296f367fd8000";
logging-data="913224"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SHDAihFbCv2MFTU78Sfs4"
Cancel-Lock: sha1:5OENZ4UQAvzmsb2iwLjEZOsHQNw=
X-newsreader: xrn 10.11
 by: Anton Ertl - Mon, 15 Jan 2024 08:01 UTC

dxf <dxforth@gmail.com> writes:
>Forth has never really tackled resolving arbitrary multiple THENs - other than
>in the limited context of CASE.

Maybe that's why extending CASE has found adoption beyond the original
source, a rarity in the NIH-dominated Forth circles in this century.

> COND
> IF ... ELSE ...
> IF ... ELSE ...
> IF ... ELSE ...
> CONT

CASE
?OF ... ENDOF
... ?OF ... ENDOF
... ?OF ... ENDOF
...
0 ENDCASE

> COND
> BEGIN
> WHILE ...
> WHILE ...
> WHILE ...
> AGAIN
> CONT

CASE
0= ?OF ENDOF
... 0= ?OF ENDOF
... 0= ?OF ENDOF
...
NEXT-CASE

Supported both in VFX (where it originated) and in Gforth.

- 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023

Re: Resolving multiple THENs

<uo53jv$1aabv$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25960&group=comp.lang.forth#25960

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: Resolving multiple THENs
Date: Tue, 16 Jan 2024 16:18:54 +1100
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uo53jv$1aabv$1@dont-email.me>
References: <uo2gj6$qrn9$1@dont-email.me>
<2024Jan15.090126@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 16 Jan 2024 05:18:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dae4aa9ce868b6bf1692a67d817b1c6c";
logging-data="1386879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19n21PDGuFZJk4E3ZD1Q6/o"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0EOgAaXY/+e8QBfmwhZ3NPw/YE0=
Content-Language: en-GB
In-Reply-To: <2024Jan15.090126@mips.complang.tuwien.ac.at>
 by: dxf - Tue, 16 Jan 2024 05:18 UTC

On 15/01/2024 7:01 pm, Anton Ertl wrote:
> dxf <dxforth@gmail.com> writes:
>> Forth has never really tackled resolving arbitrary multiple THENs - other than
>> in the limited context of CASE.
>
> Maybe that's why extending CASE has found adoption beyond the original
> source, a rarity in the NIH-dominated Forth circles in this century.
> ...
> Supported both in VFX (where it originated) and in Gforth.

Why extend CASE ? It can only be in support of ANS' restricted model.
200x could change that any time. Only reason for not doing so would be
political i.e. those who had already invested in the extensions.

Re: Resolving multiple THENs

<2024Jan16.094938@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25961&group=comp.lang.forth#25961

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Resolving multiple THENs
Date: Tue, 16 Jan 2024 08:49:38 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 31
Message-ID: <2024Jan16.094938@mips.complang.tuwien.ac.at>
References: <uo2gj6$qrn9$1@dont-email.me> <2024Jan15.090126@mips.complang.tuwien.ac.at> <uo53jv$1aabv$1@dont-email.me>
Injection-Info: dont-email.me; posting-host="d8327aa039eac118efd46eab1dc5b53e";
logging-data="1449520"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19HjG04v5iHGDKwXqDTy6W1"
Cancel-Lock: sha1:VXw+eWM/PZV4AK+hC5jNtgnzBAs=
X-newsreader: xrn 10.11
 by: Anton Ertl - Tue, 16 Jan 2024 08:49 UTC

dxf <dxforth@gmail.com> writes:
>On 15/01/2024 7:01 pm, Anton Ertl wrote:
>> dxf <dxforth@gmail.com> writes:
>>> Forth has never really tackled resolving arbitrary multiple THENs - other than
>>> in the limited context of CASE.
>>
>> Maybe that's why extending CASE has found adoption beyond the original
>> source, a rarity in the NIH-dominated Forth circles in this century.
>> ...
>> Supported both in VFX (where it originated) and in Gforth.
>
>Why extend CASE ?

Why not? We already have Eaker's CASE. Each step in extening it adds
useful functionality:

?OF turns CASE into a general conditional control structure.

NEXT-CASE allows extending that functionality to loops.

CONTOF (Gforth-only for now) allows implementing loops like those
written with the "do" command of the guarded-command language;
alternatively, one can see it as extending OF/?OF with a looping
variant like NEXT-CASE extended CASE with looping.

- 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023

Re: Resolving multiple THENs

<uo5ltg$1c7te$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25962&group=comp.lang.forth#25962

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: Resolving multiple THENs
Date: Tue, 16 Jan 2024 21:31:13 +1100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <uo5ltg$1c7te$1@dont-email.me>
References: <uo2gj6$qrn9$1@dont-email.me>
<2024Jan15.090126@mips.complang.tuwien.ac.at> <uo53jv$1aabv$1@dont-email.me>
<2024Jan16.094938@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 16 Jan 2024 10:31:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dae4aa9ce868b6bf1692a67d817b1c6c";
logging-data="1449902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/J0Rv0kO+scz8MdydZ28wY"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:EzYkIRi6I5y3IKm7kzFymPdK4Sk=
In-Reply-To: <2024Jan16.094938@mips.complang.tuwien.ac.at>
Content-Language: en-GB
 by: dxf - Tue, 16 Jan 2024 10:31 UTC

On 16/01/2024 7:49 pm, Anton Ertl wrote:
> dxf <dxforth@gmail.com> writes:
>> On 15/01/2024 7:01 pm, Anton Ertl wrote:
>>> dxf <dxforth@gmail.com> writes:
>>>> Forth has never really tackled resolving arbitrary multiple THENs - other than
>>>> in the limited context of CASE.
>>>
>>> Maybe that's why extending CASE has found adoption beyond the original
>>> source, a rarity in the NIH-dominated Forth circles in this century.
>>> ...
>>> Supported both in VFX (where it originated) and in Gforth.
>>
>> Why extend CASE ?
>
> Why not? We already have Eaker's CASE. Each step in extening it adds
> useful functionality:
>
> ?OF turns CASE into a general conditional control structure.

Forth has IF for that. Adding words to replicate functionality
that already exists is an unnecessary duplication.

> NEXT-CASE allows extending that functionality to loops.

Forth has BEGIN AGAIN. No need to duplicate it.

> CONTOF (Gforth-only for now) allows implementing loops like those
> written with the "do" command of the guarded-command language;
> alternatively, one can see it as extending OF/?OF with a looping
> variant like NEXT-CASE extended CASE with looping.

Wil Baden maintained Forth's control structures were sufficient.
Sure enough I was able to replicate your CONTOF examples using
regular forth at a similar level of complexity.

Re: Resolving multiple THENs

<nnd$289ae746$0b6bd384@bd8d8ee2bb1753fe>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25963&group=comp.lang.forth#25963

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <uo2gj6$qrn9$1@dont-email.me> <uo53jv$1aabv$1@dont-email.me> <2024Jan16.094938@mips.complang.tuwien.ac.at> <uo5ltg$1c7te$1@dont-email.me>
Subject: Re: Resolving multiple THENs
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$289ae746$0b6bd384@bd8d8ee2bb1753fe>
Organization: KPN B.V.
Date: Tue, 16 Jan 2024 13:10:16 +0100
Path: i2pn2.org!i2pn.org!news.furie.org.uk!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 57
Injection-Date: Tue, 16 Jan 2024 13:10:16 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2986
 by: none - Tue, 16 Jan 2024 12:10 UTC

In article <uo5ltg$1c7te$1@dont-email.me>, dxf <dxforth@gmail.com> wrote:
>On 16/01/2024 7:49 pm, Anton Ertl wrote:
>> dxf <dxforth@gmail.com> writes:
>>> On 15/01/2024 7:01 pm, Anton Ertl wrote:
>>>> dxf <dxforth@gmail.com> writes:
>>>>> Forth has never really tackled resolving arbitrary multiple THENs -
>other than
>>>>> in the limited context of CASE.
>>>>
>>>> Maybe that's why extending CASE has found adoption beyond the original
>>>> source, a rarity in the NIH-dominated Forth circles in this century.
>>>> ...
>>>> Supported both in VFX (where it originated) and in Gforth.
>>>
>>> Why extend CASE ?
>>
>> Why not? We already have Eaker's CASE. Each step in extening it adds
>> useful functionality:
>>
>> ?OF turns CASE into a general conditional control structure.
>
>Forth has IF for that. Adding words to replicate functionality
>that already exists is an unnecessary duplication.
>
>> NEXT-CASE allows extending that functionality to loops.
>
>Forth has BEGIN AGAIN. No need to duplicate it.
>
>> CONTOF (Gforth-only for now) allows implementing loops like those
>> written with the "do" command of the guarded-command language;
>> alternatively, one can see it as extending OF/?OF with a looping
>> variant like NEXT-CASE extended CASE with looping.
>
>Wil Baden maintained Forth's control structures were sufficient.
>Sure enough I was able to replicate your CONTOF examples using
>regular forth at a similar level of complexity.

I agree with Will.
Anton Ertl had me to reconsider where I used CASE.
Sure enough CASE is obscure, and I detected a long standing
bug in a default case. That would never happen if I
had used IF ELSE THEN .
(The code was original from Marcel Hendrix, and I got confused
converting the code for the default case
DUP ABORT" something wrong"
).

:I OF OVER = IF DROP ;
:I ENDCASE DROP THENS ;

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat purring. - the Wise from Antrim -

Re: Resolving multiple THENs

<2024Jan16.170107@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25964&group=comp.lang.forth#25964

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Resolving multiple THENs
Date: Tue, 16 Jan 2024 16:01:07 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 38
Message-ID: <2024Jan16.170107@mips.complang.tuwien.ac.at>
References: <uo2gj6$qrn9$1@dont-email.me> <2024Jan15.090126@mips.complang.tuwien.ac.at> <uo53jv$1aabv$1@dont-email.me> <2024Jan16.094938@mips.complang.tuwien.ac.at> <uo5ltg$1c7te$1@dont-email.me>
Injection-Info: dont-email.me; posting-host="d8327aa039eac118efd46eab1dc5b53e";
logging-data="1604353"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nXjxl4T7b2MqmxVIWqAz0"
Cancel-Lock: sha1:yN6KLty9UWN2BeGqtIUyfKIRelQ=
X-newsreader: xrn 10.11
 by: Anton Ertl - Tue, 16 Jan 2024 16:01 UTC

dxf <dxforth@gmail.com> writes:
>On 16/01/2024 7:49 pm, Anton Ertl wrote:
>> dxf <dxforth@gmail.com> writes:
>>> On 15/01/2024 7:01 pm, Anton Ertl wrote:
>>>> dxf <dxforth@gmail.com> writes:
>>>>> Forth has never really tackled resolving arbitrary multiple THENs - other than
>>>>> in the limited context of CASE.
....
>Wil Baden maintained Forth's control structures were sufficient.

Actually, Wil Baden showed that, with the seven words IF AHEAD THEN
BEGIN AGAIN UNTIL CS-ROLL one can construct all control structures
that one can construct with goto and conditional goto and labels.

And yet we write

begin ... while ... repeat

instead of the "sufficient"

begin ... if [ 1 cs-roll ] ... again then

And yet you proposed to introduce COND ... CONT for "resolving
arbitrary multiple THENs", which "Forth has never really tackled".

>Sure enough I was able to replicate your CONTOF examples using
>regular forth at a similar level of complexity.

Certainly one can do so, and if you prefer to do so, that's fine with
me. However, I find it easier to use the extended CASE for writing
definitions where several cases have to be considered.

- 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: https://forth-standard.org/
EuroForth 2023: https://euro.theforth.net/2023

Re: Resolving multiple THENs

<uo7cpr$1mmaf$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25966&group=comp.lang.forth#25966

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: Resolving multiple THENs
Date: Wed, 17 Jan 2024 13:07:55 +1100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uo7cpr$1mmaf$1@dont-email.me>
References: <uo2gj6$qrn9$1@dont-email.me>
<2024Jan15.090126@mips.complang.tuwien.ac.at> <uo53jv$1aabv$1@dont-email.me>
<2024Jan16.094938@mips.complang.tuwien.ac.at> <uo5ltg$1c7te$1@dont-email.me>
<2024Jan16.170107@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 17 Jan 2024 02:07:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d5673fd76df70fac4a4ac919cc2cc2bd";
logging-data="1792335"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZOCsy+xSfhvGiR43Tuscw"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:b3zdt/zuB8Pe+EnmPJgkyd/NZoI=
Content-Language: en-GB
In-Reply-To: <2024Jan16.170107@mips.complang.tuwien.ac.at>
 by: dxf - Wed, 17 Jan 2024 02:07 UTC

On 17/01/2024 3:01 am, Anton Ertl wrote:
> dxf <dxforth@gmail.com> writes:
>> On 16/01/2024 7:49 pm, Anton Ertl wrote:
>>> dxf <dxforth@gmail.com> writes:
>>>> On 15/01/2024 7:01 pm, Anton Ertl wrote:
>>>>> dxf <dxforth@gmail.com> writes:
>>>>>> Forth has never really tackled resolving arbitrary multiple THENs - other than
>>>>>> in the limited context of CASE.
> ...
>> Wil Baden maintained Forth's control structures were sufficient.
>
> Actually, Wil Baden showed that, with the seven words IF AHEAD THEN
> BEGIN AGAIN UNTIL CS-ROLL one can construct all control structures
> that one can construct with goto and conditional goto and labels.

Baden wanted goto so he could express classical algorithms as they
were originally written. It's not my need.

> And yet you proposed to introduce COND ... CONT for "resolving
> arbitrary multiple THENs", which "Forth has never really tackled".

Absolutely. Baden's CASE in three words entirely compatible with IF
and friends:

https://groups.google.com/g/comp.lang.forth/c/iQBnN-Dp_2I/m/YbSAzG__ZVYJ

was in 1997 too much of a challenge to ANS' authority. In 2024 it would
still appear to be the case.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor