On 9/19/06, Bob Rogers <[EMAIL PROTECTED]> wrote:
Hmm. Is this because Perl 5 grep can be used to modify a list in place? Does Perl 6 grep also allow that? The Lisp equivalent is remove-if-not, which otherwise seems like a perfect description of what Perl grep does.
Except that Perl lists, unlike Lisp ones, are modifiable, so I'd expect a method with "remove" in the name to actually remove stuff from the list - which grep doesn't do. It just makes a new list containing only the matching items.
In that vein, "select" from SQL should also be mentioned.
Indeed. Ruby also has "select" (an alias for "find_all"); as indicated in my last message, that's my new favorite name for this method (second only to keeping "grep"). -- Mark J. Reed <[EMAIL PROTECTED]>