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

btw: "Perl Design Patterns"

by kabel (Chaplain)
on Jun 14, 2003 at 19:04 UTC ( #265937=note: print w/replies, xml ) Need Help??


in reply to "Perl Design Patterns"

did somebody notify the map that wants to be a grep? ;-) of course, i think:
# code found under "Decorating Lists" entitled paragraph, line 6. my @files = reverse sort map { -d $_ ? $_ : () } readdir DIR;
i have not seen this solution before, but i find it all sorts from cool to strange.

strange - i think, anyone with a functional background expects that, after a map, there is exactly the same number of elements in the list as before.

cool - it shows that the grep is essential the sugar coat around the syntactic sugar. but, because the grep is a standard tool in any unix environment, the gain of expressiveness is tremendous.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://265937]
help
Chatterbox?
[Corion]: Oh yay. I wonder why a very simple change in a program doesn't elicit a diff, and now I see that my diff program seems to have a bug ;)
[1nickt]: marto thanks for asking, so far so good. A pretty modern stack and decent procedures, although rather too much home-built stuff (e.g. a logging role that should tries to duplicate Log::Any).
[Corion]: No. It's just that I'm comparing the same output file twice, instead of comparing the output files of the two runs %-)
[Corion]: Lo and behold, running a program with the correct input files yields the correct (and expected) output. Yay me.
[1nickt]: Got a MacBook and am expected to develop directly on it, ironic given the recent thread about that.
[marto]: Corion, some not too serious issues with the kids, hopefully, other than that just dealing with commuting by car again in the winter, not much fun so far, and there's no real 'bad' weather yet :)
[marto]: 1nickt, glad to hear it, I'm sure you'll bring improvements to their stack in due course ;)
[1nickt]: Just trying to adjust to a new culture. Better doc than I am used to , but quite a bit more Agiley meta-bullshit; at least half a dozen meetings a week, strict "sprint" schedule etc. I'll adjust. And I hope to just switch off after the "scrum" each day at
[1nickt]: ... the end of the afternoon. marto How are you, snowed in? Mum and Dad expecting snow today in Surrey. (Have 5" on the ground here in NJ. And my son's high school in SOCal closed until after Xmas due to fires.)
[Corion]: 1nickt: In a sense the meta-bullshit might even be beneficial to you as you get to hear the cow-orkers talk (or not talk) about the issues you perceive. I think Agile is mostly about the meta ;)

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2017-12-11 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (289 votes). Check out past polls.

    Notices?