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

Closures and CALLER

Thread Next
From:
Aaron Sherman
Date:
May 17, 2005 10:42
Subject:
Closures and CALLER
Message ID:
1116351742.27930.5468.camel@pps
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 {
		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 $_?

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



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About