Forth has never really tackled resolving arbitrary multiple THENs - other than >in the limited context of CASE.
COND
IF ... ELSE ...
IF ... ELSE ...
IF ... ELSE ...
CONT
COND
BEGIN
WHILE ...
WHILE ...
WHILE ...
AGAIN
CONT
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 ?
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.
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.
Sure enough I was able to replicate your CONTOF examples using
regular forth at a similar level of complexity.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 18:53:18 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,093 |