From 56c89c0510a16a9f52688aef4bbc2e3b7ca70e05 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 24 Mar 2010 15:26:50 -0700 Subject: [PATCH] cursors: 2each, 2map-as, 2map, using zip-cursors --- extra/cursors/cursors.factor | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extra/cursors/cursors.factor b/extra/cursors/cursors.factor index 84b3d0ef78..1d02311c2f 100644 --- a/extra/cursors/cursors.factor +++ b/extra/cursors/cursors.factor @@ -484,5 +484,11 @@ ALIAS: -2container- -assoc- : 2container- ( a b quot -- begin end quot' ) 2all- -2container- ; inline +: 2each ( ... a b quot: ( ... x y -- ... ) -- ... ) + 2container- -each ; inline +: 2map-as ( ... a b quot: ( ... x y -- ... z ) exemplar -- ... c ) + [ 2container- ] dip -map-as ; inline +: 2map ( ... a b quot: ( ... x y -- ... z ) -- ... c ) + pick 2map-as ; inline