in reply to Currying--useful examples?
There's no other way to do it, and it's pretty useful in OO programming when an interface is looking for a callback. In general, when you have to pass in a callback to some interface, you can use currying when the calling interfaces don't quite match up (the callback will be called with certain arguments, but the subroutine you have expects more/less/different arguments).my $coderef = sub { $obj->method(@_) };
Sorry that this example is still pretty abstract.. ;)
blokhead
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Currying--useful examples?
by f00li5h (Chaplain) on Jan 11, 2007 at 11:19 UTC |