Bob La Quey wrote:
where
     v1 puts a b c on the stack

Except he's making it match the C and Erlang versions. If you not, a vector for him is a pointer to a three-tuple. I think from that the rest of your analysis is broken.

Good Forth programs rarely are working with more than three or four
items on the stack.

He starts with 3 items on the stack. I think the point he's making is that doesn't leave a whole lot of room for picking down into the stack.

Further v1 and v2 should probably be defined using <BUILDS DOES>
and then simple accessors pull up the vector components a, b, c.

That's what his "1st" and "2nd" and "3rd" words are doing.

http://weblog.lowpro.ca/wp-content/uploads/2007/08/venn_diagram_example.gif

What about vectors with more components? Probably use pointers, something
like this.

He's already using pointers.

        This puts them on the return stack.  Then you need to pull
         them off and use them or put them somewhere.

The "somewhere" gets passed into his function. I think you've just now figured out how his function is defined.

Of course, that it wasn't obvious until I re-read the code just goes to show that FORTH isn't all that readable, tho.

--
Darren New / San Diego, CA, USA (PST)
 Ever notice how people in a zombie movie never already know how to
 kill zombies? Ask 100 random people in America how to kill someone
 who has reanimated from the dead in a secret viral weapons lab,
 and how many do you think already know you need a head-shot?

--
KPLUG-LPSG@kernel-panic.org
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to