I think it is an interesting idea to be able to bind any argument
position. Think I mentioned it earlier in the 1.5 API discussion that
we now have quite a few variants of bind-like functions -- bind,
bindLate, bindMethods, forwardCall, partial, method, methodCaller...
Too many for my taste, so I think it is time to revisit these API:s.
Perhaps something more generic than the current bind() might be a good
idea? Or perhaps it would have an API that is too complex? Don't know
really.
I'll look into the code posted by Arnar later on (no much time right
now) and comment on the specifics then.
Cheers,
/Per
On Sun, Dec 14, 2008 at 1:53 AM, Arnar Birgisson wrote:
>
> On Sat, Dec 13, 2008 at 23:26, Eoghan wrote:
>> May I suggest MochiKit.Base.__ as the name of the placeholder
>> variable.
>
> If Bob or Per want to include this, I'd like to change it to make it
> compatible with the current partial (namely, any extra parameters
> passed on the call itself will just be tacked on the end).
>
> MochiKit.Base.__ sounds good to me. Just _ is more likely to step on
> someone's toes.
>
>> I can't imagine needing the permuting version myself.
>
> Actually, 95% of the cases I've wanted this I just wanted flip
> (reverse the order of two parameters). At the very least I'd like to
> see
>
> function flip(f) {
>return function (x,y) { return f(y,x); };
> }
>
> included. In other cases, I have definitely had use for the generic
> permuting version.
>
> cheers,
> Arnar
>
> >
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to
mochikit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---