Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re (tilly) 2 (expectations): Apparent Inconsistencies in Perl Function Naming

by tilly (Archbishop)
on Nov 25, 2000 at 21:32 UTC ( #43321=note: print w/ replies, xml ) Need Help??


in reply to Re: Apparent Inconsistencies in Perl Function Naming
in thread Apparent Inconsistencies in Perl Function Naming

Nat's suggestion fails to meet my expectations. Mine would be that length should work something like this:

sub length { if (1 == @_) { return CORE::length(shift); } else { return map {CORE::length($_)} @_; } }
IOW return a list of lengths instead of the number of things in the array. (Which I can easily get anyways.)

Perl can't match both my expectations and princepawn's...


Comment on Re (tilly) 2 (expectations): Apparent Inconsistencies in Perl Function Naming
Download Code
Re: Re (tilly) 2 (expectations): Apparent Inconsistencies in Perl Function Naming
by swiftone (Curate) on Nov 28, 2000 at 02:31 UTC
    IOW return a list of lengths instead of the number of things in the array. (Which I can easily get anyways.)

    Really then, shouldn't length return a list or a scalar depending on the context in which it was called? :)

    Note to all: If you don't see the humor in this, reread the thread

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://43321]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-12-26 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls