Aaron Sherman wrote:
On Wed, 2005-03-16 at 02:18 -0600, Rod Adams wrote:
I just posted a fresh copy of S29 to:
http://www.rodadams.net/Perl/S29.pod
http://www.rodadams.net/Perl/S29.html
Couple more points from the docs (mostly to the list, but some to you,
Rod):
multi sub grep (Any|Junction $test : [EMAIL PROTECTED]) returns List {
multi sub join (Str $delimiter : [EMAIL PROTECTED]) returns List {
multi sub map (Code $expression : [EMAIL PROTECTED]) returns List {
multi sub reduce (Code $expression : [EMAIL PROTECTED]) returns List {
...
I presume that everything is being declared as multi because we wish
future subs to be able to insert special-cases for their own purposes.
Something like that. Also, it's looking now like several of the
functions will be getting multiple definitions out of the box.
The question then comes up: is there a reason that you would declare a
normal sub in library code... ever? Is plain "sub" no just a request for
mildly unusual optimization? If so, why not make it "nomulti" instead?
To establish one single version of the function that will be called no
matter what. (within it's scope). A sub with a given name will mask any
multi of that name.
And they should be significantly faster to call.
-- Rod Adams