On Tue, May 17, 2005 at 01:01:48PM -0500, Rod Adams wrote:
: Aaron Sherman wrote:
:
: >Ok, so log and log10:
: >
: > multi sub Math::Basic::log (: Num ?$x = $CALLER::_, Num +$base);
: > &log10<> := &log<>.assuming:base(10);
: >
: >What does log get in this case:
: >
: > for @x {
: > log10();
: > }
: >
: >Does the curried log10 execute the defaulting for the sub it's based on
: >(and thus need run-time access to the default value, which I assume is
: >not in the signature) or does it leave defaulting up to log, in which
: >case, how does log find the right $_?
: >
:
: I had assumed that wrapper a curries function generates does not alter
: who the CALLER is. Therefore, when log10() is called, the CALLER for
: log() is the same as the CALLER for log10.
:
: IMO, if this is not the case, it severely limits the utility of curried
: functions. Comments from @Larry requested.
Makes sense to me. I don't think .assuming should assume anything that
is not explicitly specified as assumed, so defaults should not resolve
till the "real" call.
Larry