Hi list,

Hoping someone can help me here, I'm having a little trouble with
implementing some combinators.

For instance, I'm just trying to implement 'map' first b/c it's fairly
simple.  The datastack is implemented
as a linked list, and quotations are implemented as a custom cons tuple
(TUPLE: joy-cons { car read-only } { cdr read-only } compiled-quot ;).
As an example, let's use [1 2 3] [1 +] map .
[1 2 3] is a linked list (cons tuple) like the Lisp (1 ( 2 ( 3 . nil ) ) ).
The quotation [1 +] is a joy-cons linked list that gets jit-compiled to [ 1
dstack-push +-joy ], which will push 1 onto the Joy datastack,
and then take two items off, add them, and push the result back onto the Joy
datastack.

So I have been unable so far to come up with a good solution for
implementing a way for the 'map' combinator to apply the quotation
to each element of the list and collect the results (obviously what 'map'
does).  Any help is appreciated !

The (currently kind of working and kind of broken) code is at:
[email protected]:inforichland/Joy.git

Cheers,
 - Tim
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to