Re: More fun with Miser's CASE
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: More fun with Miser's CASE         

Group: comp.lang.forth · Group Profile
Author: Ed
Date: Jul 7, 2008 08:32

"Gerry" jackson9000.fsnet.co.uk> wrote in message
news:5895779b-65ba-4ca7-a4a2-5a2cb7ceb984@e39g2000hsf.googlegroups.com...
> On 5 Jul, 07:30, "Ed" invalid.com> wrote:
>
> [...]
>
>>
>> It's limited to conditionals which bump the count. Should one
>> encounter Miser code like:
>>
>> CASE
>> ( any test ) IF ( DROP) ... ELSE
>> ENDCASE
>>
>> it will fail.
>>
>> In the above example I used IF but any conditional or sequence
>> that left an 'orig' may be used in Miser. All these would fail in
>> solution 2 because they don't bump the count.
>>
>
> I think I misunderstood what you were trying to achieve. So you
> would expect anything that leaves an extra orig on the control
> stack such as AHEAD, WHILE ... WHILE etc would have that orig
> resolved by a later CONTINUE, WHEN or ENDCASE (with suitable
> manipulation of the control stack of course). In which case I
> agree a count can't be used portably.

Yes, though I haven't yet explored those possibilities.
The main criteria was that IF should work. Just as EQUAL,
RANGE, OF were defined using IF, users will be needing IF
to define their own extensions. e.g. one might want a string
case:

: $OF
postpone 2over postpone compare postpone 0=
postpone if postpone 2drop ; immediate

This wouldn't work on your count-based system.

--
I thought I had better clarify that in case there were any
misconceptions as to why I needed IF to work.
no comments
diggit! del.icio.us! reddit!