in reply to Re: Re: Think for yourself.
in thread is the use of map in a void context deprecated ?
While I have no trouble understanding a map in void context, using a map for its side-effects violates my expectations of what map is for.
I think this is the main point where you and I differ. What makes "map" so holy that it shouldn't be used for side-effects? Who or what started this notion? Not Larry, otherwise he wouldn't have made $_ an alias for the list element being processed. Many functions in Perl have side-effects, both user defined and core functions. Why is it fine to have side-effects in a 'for', but not in a 'map'? It's not that 'map' is called 'apply_a_function_and_return_a_list_of_calculated_values'. 'map' just means 'map a function over a list' - and I've been familiar with both the name and its function longer than Perl exists.
Abigail
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Think for yourself.
by tilly (Archbishop) on Oct 08, 2003 at 02:43 UTC | |
Re: Re: Think for yourself.
by zby (Vicar) on Oct 08, 2003 at 10:27 UTC |
In Section
Seekers of Perl Wisdom