gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gforth] CASE syntax?


From: Terrence Brannon
Subject: [gforth] CASE syntax?
Date: Sat, 6 Mar 2010 17:54:56 -0500

The documented CASE syntax:
http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Selection.html#Selection

terminates with

 ( n ) default-code ( n )
     ENDCASE ( )

but I grepped the source tree and
1 - nowhere after default-code is ( n ) seen.
2 - nowhere after ENDCASE is ( ) seen.

The best example I could find in the source tree was:

: address@hidden ( n -- ) \ gforth compile-f-fetch-local
 case
    0        of postpone address@hidden endof
    1 floats of postpone address@hidden endof
   ( otherwise ) dup postpone address@hidden ,
 endcase ;

And clearly there is no ( ) after ENDCASE.

I cant say whether there is ( n ) after default-code because I am
completely confused by this Forth code. It is far too advanced for me
to understand completely.

At any rate, I think a fully fleshed out simple example would be
helpful to Neophyte FORTHers.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]