develooper Front page | perl.perl6.language | Postings from May 2005

Closures and CALLER

Thread Next
Aaron Sherman
May 17, 2005 10:42
Closures and CALLER
Message ID:
Is it a bad sign that I'm still on the first section of S29, getting up
to speed? Sigh... I'll get there, really. This is another question from
my reading this morning.

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 {

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 $_?

Aaron Sherman <>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About