On 01/14/2013 10:12 PM, Herman Radtke wrote:
If it is called "array_pluck" it should remove the data in question from the
original array. (I'm not saying that is a desirable feature here, I'm just
saying that makes more sense based on the meaning of the name you seem to
prefer.)
Why do you think pluck is destructive? In most examples I have come
across it merely 'plucks' a certain key from a dictionary and does so
in a way that does not modify the original dictionary.
Sources:
Underscore.js - http://documentcloud.github.com/underscore/#pluck
Rails - http://apidock.com/rails/ActiveRecord/Calculations/pluck
Python example: http://stackoverflow.com/questions/9816545/pluck-in-python
Sources:
1. google: "define: pluck"
"Take hold of (something) and quickly *remove* it from it's place"
2. http://www.merriam-webster.com/dictionary/pluck
"to pull or *pick* off or *out*"
3. http://www.thefreedictionary.com/pluck
"To *remove* or detach ..."
Emphasis added. The connotation of the word is that something is
*removed* from it's original place.
Just because other languages/frameworks have made a poor naming choices
doesn't mean PHP should too. In this case, there is already an
alternatively proposed method name which is more obvious way to name the
method that fits within the established PHP conventions.
I'm picky about naming things. :-)
-Matt
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php