Ruby Murray, a Ruby port of Perl's Sub::Curry (with added Ruby
goodness), is now available in it's first 0.1.2 release.
Ruby Murray allows block arguments to be supplied prior to calling (to
be 'curried') and also supports a range of features that allow arguments
to be populated in arbitrary order and with complex processing.
cool naming, nice functionality, easy using.
AFAIK this is a instantiation of the Design Pattern called "Command" by
the Gang of Four.
i can not imagine a problem where i needed such flexible argument list.
can anyone provide a motivation example in ruby?
i'd suggest to add a small sample of usage to the docs.
-- henon
On 2006-02-21 12:08:22 -0500, "henon" <meinrad.recheis@gmail.com> said:
cool naming, nice functionality, easy using.
AFAIK this is a instantiation of the Design Pattern called "Command" by
the Gang of Four.
i can not imagine a problem where i needed such flexible argument list.
can anyone provide a motivation example in ruby?
i'd suggest to add a small sample of usage to the docs.
-- henon
Actually, I don't think there's anything in Ruby that can't be done
(better) some other way, but currying is one of those higher-order
things that every (decent) language should have ;).
log_now["First Message."] # => [12:47:53 PM 02/01/06] First Message.
sleep 3
log_now["Second Message."] # => [12:47:56 PM 02/01/06] Second Message.
Again, not something that's difficult to do by other means (default
argument values for example) but, well, there you go.
···
On Wed, 2006-02-22 at 02:13 +0900, henon wrote:
cool naming, nice functionality, easy using.
AFAIK this is a instantiation of the Design Pattern called "Command" by
the Gang of Four.
i can not imagine a problem where i needed such flexible argument list.
can anyone provide a motivation example in ruby?
i'd suggest to add a small sample of usage to the docs.
-- henon
> Oh, I never said it was _useful_
in fact it is very useful for most elegantly implementing undo/redo
commands. i was just curious about other applications.