combinators.extras: adding 3bi* and 3bi@.

db4
John Benediktsson 2013-05-01 18:34:27 -07:00
parent 16d24a5194
commit 1bf876fc06
2 changed files with 10 additions and 0 deletions

View File

@ -23,3 +23,7 @@ IN: combinators.extras.tests
] unit-test
{ { 1 2 3 } } [ 1 { [ ] [ 1 + ] [ 2 + ] } cleave-array ] unit-test
{ 2 15 } [ 1 2 3 4 5 6 [ - - ] [ + + ] 3bi* ] unit-test
{ 2 5 } [ 1 2 3 4 5 6 [ - - ] 3bi@ ] unit-test

View File

@ -18,3 +18,9 @@ MACRO: cond-case ( assoc -- )
MACRO: cleave-array ( quots -- )
[ '[ _ cleave ] ] [ length '[ _ narray ] ] bi compose ;
: 3bi* ( u v w x y z p q -- )
[ 3dip ] dip call ; inline
: 3bi@ ( u v w x y z quot -- )
dup 3bi* ; inline