in reply to Re^2: Near-free function currying in Perl
in thread Near-free function currying in Perl
sub foo ($$;$) { ... } my $curried_foo = foo( 1 ); my $return_value = foo( 1, 2 );
I'm thinking a source filter would be needed to convert
Wouldn't that work?sub foo ($$;$) { ... } to sub foo { if (@_ < 2) { my $arg = shift; return sub { foo($arg, @_) }; } ... }
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Near-free function currying in Perl
by tmoertel (Chaplain) on Nov 17, 2004 at 17:23 UTC | |
by stvn (Monsignor) on Nov 17, 2004 at 18:14 UTC | |
by tmoertel (Chaplain) on Nov 17, 2004 at 22:20 UTC | |
by stvn (Monsignor) on Nov 17, 2004 at 22:57 UTC | |
by FoxtrotUniform (Prior) on Nov 18, 2004 at 08:13 UTC | |
| |
Re^4: Near-free function currying in Perl
by stvn (Monsignor) on Nov 17, 2004 at 15:45 UTC | |
by dragonchild (Archbishop) on Nov 17, 2004 at 16:20 UTC | |
by stvn (Monsignor) on Nov 17, 2004 at 16:40 UTC | |
by dragonchild (Archbishop) on Nov 17, 2004 at 17:01 UTC |