CLIP some more!
Tue, 21 Mar 2000 11:01:23 -0800 (PST)
> [variable stack effect words]
> Generally speaking, if you play with more than 3 stack elements, your code
> needs a redesign.
This would be true I guess in most Forth systems and in Joy.
But, I still wonder if maybe playing with more things than 3 on the
stack wouldn't be so bad if the system were designed for it from
the ground up...
Either way, it does seem important that the system provide some form
of list mechanism, so that (roughly speaking) multiple things
could be passed around as if they were one thing. For this purpose,
I think the pure-program-that-pushes-some-things-onto-the-stack
makes a good substitute for a list, so that a system would not need
special primitives for lists (actually, this seems to be the way Joy
I'm still uncertain about how to handle the issue of the size of
the list, whether it will be explicitly contained as the first member
or if it will be accessible only by some magical "length" program that
takes a program and tells how many things it would push onto the stack.
I'm leaning toward the first approach (length contained as an explicit
member, the first of the tuple).
> >If I do end up using unified lists (and this is likely), the main
> >primitives will just be "wrap" and "unwrap" (in the absense of
> >"reverse", "map", "concat", and things)... If one wants to do
> >more complex things with lists, then the thing to do is to unwrap
> >them first and then use the variable-stack-effect words (and
> >then wrap it back up again, if needed) ...
> You haven't done much Forth coding, have you? The variable-effect words are
> so destructive to understanding that I have seriously never seen any in any
> Forth code.
Well... indeed, I haven't done much Forth coding; actually, I have
done no Forth coding... someday I'll have to dig up an interpreter,
Oh, by the way, I've been working on a little Joy-like interpreter,
which may find itself in some form in the IOCCC if I get finished
in time :-)
Sometime I'd like to make a small speedy Joy-like system, that is not
based on a slow interpreter loop. But this is probably too ambitious,
as I've never written or hacked compilers.
Anyway, sorry for taking forever to get this message out.
I think I've sort of lost track of all these posts; it may be that
there are some things you've written that I haven't replied to.
Of course, if you want to bring anything up again, feel free...
> >- "iepos" (Brent Kerby)
- "iepos" (Brent Kerby)