Hello,

The retainstack heavy code in locals suggests words like n>r, nr>, and nrpick. 
nrpick pulls out the nth object on the retainstack. The n* words in the 
shuffle vocabulary are 1-based so I made nrpick that way too. Here they are 
as macros:

MACRO: n>r ( quot -- ) [ drop \ >r ] map >quotation ;

MACRO: nr> ( quot -- ) [ drop \ r> ] map >quotation ;

MACRO: nrpick ( quot -- )
  [ dup , \ nr> ,   dup 1 - , \ ntuck ,   , \ n>r , ] [ ] make ;

The definition of nrpick is not too pretty because of the make. I would have 
preferred to use MACRO:: like so:

MACRO:: nrpick | n |
  [ n nr>   n 1 - ntuck   n n>r ] ;

However, that version of nrpick doesn't work. Slava, any idea why? I expect 
the nrpick macro to expand to a quotation that looks something like:

        [ 3 nr>   3 1- ntuck   3 n>r ]

which works if called at a listener.

Ed

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to