More noodling:

It occurred to me that since most of the sequence combinators use nth 
iteratively, maybe we actually have a cursor protocol already. The names 
of the generic words don't work, but if we treat the following words as 
if they had a slightly different meaning:

nth ( cursor seq -- elt )

length ( seq -- cursor )

1+ ( cursor -- cursor )

Then all that's needed is for the combinators to call a 'begin' word in 
order to obtain the cursor in its inital state (i.e. fixnum 0 for the 
current containers).
(actually 1+ isn't a generic word, but you get the idea)

N.B. Not suggesting this is a solution, just thinking aloud. I suppose 
the useful bit is that the cursor doesn't actually need to be a 
specially allocated tuple.

-Phil


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to