Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^6: Miscellaneous.pm?

by polettix (Vicar)
on Mar 06, 2006 at 10:03 UTC ( [id://534698]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^5: Miscellaneous.pm?
in thread Miscellaneous.pm?

I don't think to understand thoroughly, but it probably stems from the fact that I'm English impaired.

About the syntax, it seems to me that the whole point of both List::Util and List::MoreUtils is to try and mimic the celebrated built-ins for dealing with lists, namely sort, grep and map. This is probably why the two modules are "poisoned with prototypes". The net effect is that you don't have to learn a new, particular syntax, just reuse what you're already comfortable with.

About the interaction between the two modules, AFAIK the author of List::Util was not willing to include other functions inside it, and this basically led to List::MoreUtils. I wouldn't prepare and maintain a module if I wouldn't believe in what I'm putting into it :)

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Replies are listed 'Best First'.
Re^7: Miscellaneous.pm?
by diotalevi (Canon) on Mar 06, 2006 at 10:50 UTC

    It's blatantly wrong to try to mimic built-in syntax for non-builtins. That is, I already know it's not a builtin and everyone using it is expected to know that. Given that, it ought to act like a user function!


    BTW, I'm just being blatantly opinionated here.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      It's blatantly wrong...

      I've been following this thread with curiousity for a bit -- but now I think it's become raw opinion over considered debate.

      Here's what I want to know:

      • Why is it blatant?

      • Why is it wrong?

      Considering that perlsub explicitly discusses using prototypes to mimic builtins, I don't buy blatant. I do know how prototypes can often lead people to unexpected behavior, but sub(&@) seems like one of the safest prototypes to use -- and that's most (though not all) of what's in List::MoreUtils.

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://534698]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.