Rosetta Code:Village Pump/Suggest a programming task: Difference between revisions

Content added Content deleted
(→‎Unsorted: delete-if-not filter! Array#select!)
Line 289: Line 289:
:This is an Anti-pattern. Why code it? --[[User:Paddy3118|Paddy3118]] 19:57, 5 April 2011 (UTC)
:This is an Anti-pattern. Why code it? --[[User:Paddy3118|Paddy3118]] 19:57, 5 April 2011 (UTC)
:: Perhaps the original commenter overspecified. Make it less specific? Call it [[Set filter]]. --[[User:Short Circuit|Michael Mol]] 20:16, 5 April 2011 (UTC)
:: Perhaps the original commenter overspecified. Make it less specific? Call it [[Set filter]]. --[[User:Short Circuit|Michael Mol]] 20:16, 5 April 2011 (UTC)
::: Some languages provide this operation, exactly as the original commenter specified. Common Lisp has ''delete-if-not'', Factor has ''filter!'', and Ruby has ''Array#select!''. Java hackers might implement this with [http://download.java.net/jdk7/docs/api/java/util/Iterator.html#remove() java.util.Iterator.remove()] from [http://download.java.net/jdk7/docs/api/ Java API]. I added this task as an option to [[Filter]], along with code for Factor and Ruby. (The page already had Common Lisp.) --[[User:Kernigh|Kernigh]] 01:55, 6 April 2011 (UTC)


==Insufficient information==
==Insufficient information==