{ 103 203 { { 1 1 } { 2 2 } { 3 3 } } }
[ 100 200 { { 1 1 } { 2 2 } { 3 3 } } [ [ 1 + ] bi@ ] 2temp2d assoc-map ] unit-test
+{ 10 } [ 5 [ 2 * ] plox ] unit-test
+{ f } [ f [ 2 * ] plox ] unit-test
+
+{ 12 } [ 12 [ odd? ] [ 2/ ] plox-if ] unit-test
+{ 6 } [ 13 [ odd? ] [ 2/ ] plox-if ] unit-test
: plox ( ... x/f quot: ( ... x -- ... y ) -- ... y/f )
dupd when ; inline
+: plox-if ( ... x quot: ( ... x -- ... ? ) quot: ( ... x -- ... y ) -- ... y/f )
+ [ keep swap ] dip when ; inline
+
MACRO: smart-plox ( true -- quot )
[ inputs [ 1 - [ and ] n*quot ] keep ] keep swap
'[ _ _ [ _ ndrop f ] smart-if ] ;