with* is for use with assoc-map and assoc-each. Using the normal
with, the stack looks like
key
obj
value
but with* makes it
obj
key
value
like you might expect. And you can call with* many times in a row for:
obj
obj
obj
key
value
100 10 { { 1 2 } { 3 4 } } [ >r + + r> ] with* with* assoc-map
Ed is experimenting with a way to generalize with/with*/curry etc.
Doug
On Feb 4, 2008, at 5:09 AM, Phil Dawes wrote:
> Hi,
>
> I'm struggling to see the point of with* from combinators.lib in
> the git
> repo:
>
> : with* ( obj assoc quot -- assoc curry )
> swapd [ [ -rot ] dip call ] 2curry ; inline
>
> As far as I can see, it takes an element from the 2nd position in the
> stack, and curries it into the 3rd inside the quotation.
>
> On the other hand I could see the point of the following:
>
> : my-with* ( param obj obj quot -- obj obj curry )
> [ rot ] dip [ [ -rot ] dip call ] 2curry ; inline
>
> (which is 'with' one space to the left). Is the with* in the repo a
> mistake, and if not, what's is its purpose?
>
> Thanks
>
> Phil
>
>
> ----------------------------------------------------------------------
> ---
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk