Extra combinators


Call a quotation one, two or three times:
once ( quot -- )

twice ( quot -- )

thrice ( quot -- )


Endless loops:
forever ( quot -- )


An easier cond combinator:
cond-case ( assoc -- quot )


Cleave into an array:
cleave-array ( quots -- quot )


More dataflow combinators:
4bi ( w x y z p q -- )

3bi* ( u v w x y z p q -- )

4bi* ( s t u v w x y z p q -- )

3bi@ ( u v w x y z quot -- )

4bi@ ( s t u v w x y z quot -- )


4tri ( w x y z p q r -- )

3tri* ( o s t u v w x y z p q r -- )

4tri* ( l m n o s t u v w x y z p q r -- )

3tri@ ( r s t u v w x y z quot -- )

4tri@ ( o p q r s t u v w x y z quot -- )


quad ( x p q r s -- )

2quad ( x y p q r s -- )

3quad ( x y z p q r s -- )

4quad ( w x y z p q r s -- )

quad* ( w x y z p q r s -- )

2quad* ( o t u v w x y z p q r s -- )

3quad* ( k l m n o t u v w x y z p q r s -- )

4quad* ( g h i j k l m n o t u v w x y z p q r s -- )

quad@ ( w x y z quot -- )

2quad@ ( s t u v w x y z quot -- )

3quad@ ( o p q r s t u v w x y z quot -- )

4quad@ ( k l m n o p q r s t u v w x y z quot -- )


quad-curry ( x p q r s -- p' q' r' s' )

quad-curry* ( w x y z p q r s -- p' q' r' s' )

quad-curry@ ( w x y z q -- p' q' r' s' )


Stack permuting versions of keep and dip:
keep-1up ( quot -- quot )

keep-2up ( quot -- quot )

keep-3up ( quot -- quot )

2keep-1up ( quot -- quot )

2keep-2up ( quot -- quot )

2keep-3up ( quot -- quot )

3keep-1up ( quot -- quot )

3keep-2up ( quot -- quot )

3keep-3up ( quot -- quot )


keep-under ( quot -- quot' )

2keep-under ( quot -- quot' )

3keep-under ( quot -- quot' )

4keep-under ( quot -- quot' )


dip-1up ( ..a d quot: ( ..a -- ..b o ) -- ..b d o )

dip-2up ( ..a d quot: ( ..a -- ..b o1 o2 ) -- ..b d o1 o2 )

2dip-1up ( ..a d1 d2 quot: ( ..a -- ..b o ) -- ..b d1 d2 o )

2dip-2up ( ..a d1 d2 quot: ( ..a -- ..b o1 o2 ) -- ..b d1 d2 o1 o2 )

3dip-1up ( ..a d1 d2 d3 quot: ( ..a -- ..b o ) -- ..b d1 d2 d3 o )

3dip-2up ( ..a d1 d2 d3 quot: ( ..a -- ..b o1 o2 ) -- ..b d1 d2 d3 o1 o2 )

3dip-3up ( ..a d1 d2 d3 quot: ( ..a -- ..b o1 o2 o3 ) -- ..b d1 d2 d3 o1 o2 o3 )


2craft-1up ( ..a quot1: ( ..a -- ..b o1 ) quot2: ( ..b -- ..c o2 ) -- ..c o1 o2 )

3craft-1up ( ..a quot1: ( ..a -- ..b o1 ) quot2: ( ..b -- ..c o2 ) quot3: ( ..c -- ..d o3 ) -- ..d o1 o2 o3 )

4craft-1up ( ..a quot1: ( ..a -- ..b o1 ) quot2: ( ..b -- ..c o2 ) quot3: ( ..c -- ..d o3 ) quot4: ( ..d -- ..e o4 ) -- ..e o1 o2 o3 o4 )


3- and 4-element versions of and and or:
3and ( a b c -- ? )

4and ( a b c d -- ? )

3or ( a b c -- ? )

4or ( a b c d -- ? )