]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences.extras: adding 2map!.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 9 Aug 2012 03:55:26 +0000 (20:55 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 9 Aug 2012 03:55:26 +0000 (20:55 -0700)
extra/sequences/extras/extras.factor

index 835f998f1c1352afdc581e74fda5f9f7fefe4283..6fffa4fe45f71dc0faf79f776cb5d0e5ceb7c4ff 100644 (file)
@@ -230,3 +230,6 @@ PRIVATE>
 
 : 2map-into ( seq1 seq2 quot into -- )
     [ (2each) ] dip collect ; inline
+
+: 2map! ( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... newelt ) -- ... seq1 )
+    pick [ 2map-into ] keep ; inline