![]() |
|
No such thing as a small change | |
PerlMonks |
Re^2: Want for a name? (Final thoughts; strong feelings; votes?)by smls (Friar) |
on Dec 12, 2013 at 14:40 UTC ( #1066854=note: print w/replies, xml ) | Need Help?? |
One reasonable metric for rating them might be: Imagine you're seeing the function name for the first time, together with a definition of its signature (parameter/return types). Would you have guessed its correct meaning? How sure would you have been? Of course that's still subjective, so let me present my intuitive reactions so that you can compare them to your own: Simple version of the function: Map a list to all its subsequences of 2 adjacent itemsFor the "pairwise" version, the function would only take a code block and a list. Given that function signature, I think the only ones for which I would have guessed the correct meaning and would have been reasonably sure about it, are:
A few comments on some of the others:
Generalized version of the function: Map a list to all its subsequences of n adjacent itemsIn this case, the function would likely take a code block, a number, and a list. Unfortunately, I don't think I would be very sure about any of my guesses in this scenario, for any of the suggested names. One that hasn't been suggested yet (probably because it's too long), but would be pretty self-explanatory for me, is:
Those where there's at least a decent chance that I would have guessed the correct meaning, are, in descending order:
moving is nice because it's effectively a generalization of "moving average" to "moving <custom calculation>"...
...but of course if the context in which you're using it has nothing to do with statistics, that recognition value will be lost. between and map_right_neighbour wouldn't work at all anymore for n > 2.
In Section
Seekers of Perl Wisdom
|
|