On 2-Sep-07, at 3:50 PM, Eduardo Cavazos wrote: > > On Sunday 02 September 2007 14:14, Slava Pestov wrote: > >> Remember, locals don't mix with >r/r>. > > Right, but the macro is a parse time thing and the retainstack > values to be > manipulated are a runtime thing. So I thought it would be OK to use a > locals-macro to do the expansion. E.g. let's say I have 4 values on > the > retainstack. Doing 3 nrpick should expand to > > [ 3 nr> 3 1 - ntuck 3 n>r ]
Actually, it expands to [ 3 dup >r nr> r> dup >r 1 - ntuck r> dup >r n>r r> drop ] Or something like that. The 3 is curried onto the quotation. Closure reification doesn't destructure quotations, it just curries values onto them, so that you can compile code like the following: [| x | [| y | x y + ] map ] Here, the 'x' is curried onto the inner quotation at run-time. > Also, as far as locals mixing with retainstack manipulations, I > thought it was > OK to use >r and r> in a locals-body as long as what's in between > the >r and > r> didn't refer to any local-variables. Did that change? I see that > the > documentation says don't mix them at all. I'd play it safe and not mix them at all. You can always use dip instead, which works fine. Slava ------------------------------------------------------------------------- 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
