[EMAIL PROTECTED] wrote:
> curry. Curries (binds an argument to) a function or method.
> Preserves this if it is bound.
>
> ltrim = String.prototype.replace.curry(/^\s*/,'');
> ' hello'.ltrim(); // => 'hello'
>
> rcurry. Curries an argument to the end (instead of the beginning) of
> the argument list. Useful for binding arguments for things like event
> handlers, where the initial argument is always the event.
I know I don't really get a vote on these things :), but I'd love to see these
in Prototype. There are so many times that I want to pass a function as a
callback with 1 arg and doing
function() { other_func(arg) }
just looks ugly.
--
Michael Peters
Developer
Plus Three, LP
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---