Also, for your case a sequence of two elements can be treated a bit like a map 
of key/value pairs.  You can use the "assocs" vocabulary to manipulate your 
sequence (called an association list or 'alist' in the documentation).

Try:

( scratchpad ) USE: assocs
( scratchpad ) \ assoc-map help
( scratchpad ) \ assoc-each help




On Aug 21, 2011, at 11:26 AM, "Alexander J. Vondrak" <ajvond...@csupomona.edu> 
wrote:

> first2: http://docs.factorcode.org/content/word-first2,sequences.html
> 
> In general, firstn: 
> http://docs.factorcode.org/content/word-firstn,sequences.generalizations.html
> 
> Regards,
> --Alex Vondrak
> ________________________________________
> From: Andrew Pennebaker [andrew.penneba...@gmail.com]
> Sent: Sunday, August 21, 2011 11:20 AM
> To: Factor
> Subject: [Factor-talk] sequences and the stack
> 
> The stack contains a sequence of number pairs:
> 
> { { x1 y1 } { x2 y2 } { x3 y3 } ... }
> 
> I want to map over the pairs, accessing xi and yi.
> 
> [
>   ! stack = { xi yi }
> 
>   ! ...
> 
>   ! stack = xi yi
> ] map
> 
> What's the code that goes in !... ?
> 
> Other than using nth, how can I do this? Is there a word that pops the 
> elements of a sequence onto the stack?
> 
> Cheers,
> 
> Andrew Pennebaker
> www.yellosoft.us<http://www.yellosoft.us>
> 
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
> user administration capabilities and model configuration. Take 
> the hassle out of deploying and managing Subversion and the 
> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to