by m_l_g3@[EMAIL PROTECTED]
Mar 12, 2008 at 11:14 AM
1) The words CASE and ENDCASE are already taken: please find other
names. CASE is not necessarily an immediate 0.
2) Do you have an implementation that uses tables? You could. You
could switch to interpretation state between COND and WHEN.
3) You cannot rely on the size of orig and dest being 1 or 2 cells:
$ gforth
Gforth 0.6.2, Copyright (C) 1995-2003 Free Software Foundation, Inc.
0 value orig-size ok
: foo [ depth to orig-size ] if [ depth orig-size - to orig-size ]
then ; ok
orig-size . 3 ok
0 value dest-size ok
: bar [ depth to dest-size ] begin [ depth dest-size - to dest-size ]
until ; ok
dest-size . 3 ok
In fact, it, at least in theory, may be 0 cells on the data stack
(and N cells on some other stack).