Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Simplifying repeated parameter lists

by Voronich (Hermit)
on Sep 19, 2012 at 20:14 UTC ( #994523=note: print w/ replies, xml ) Need Help??


in reply to Re: Simplifying repeated parameter lists
in thread Simplifying repeated parameter lists

I'm not gonna lie, my reaction was a healthy combination of "Neat! wait...why?"

I'm keeping that in the bag of tricks, 'cause I think if I go spend some time in the machine shop I'll get hit with a "THAT'S why!".


Comment on Re^2: Simplifying repeated parameter lists
Re^3: Simplifying repeated parameter lists
by roboticus (Chancellor) on Sep 19, 2012 at 20:51 UTC

    Voronich:

    Admittedly, it's probably more "neat-o!" than practical. (Though it's just useful enough for me to drop into my bag-o-tricks module for general use.) It probably only pulls its weight when you have multiple sets of default arguments and/or multiple different functions you want to decorate.

    There might be a few useful variations, too. For example, might want to make a bunch of default arguments at the *end* of your list (such as for adding formats to cells using Spreadsheet::WriteExcel.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      yeah the more I reread that the more it becomes that it's going to make it in to my code before too terribly long.

      for instance: the "submit_thingamabob" function is a nasty piece of databasocity. If I could reasonably swap that call out and replace it with a mock, without mucking too much with the existing code, it would speed development remarkably.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2015-07-05 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls