check-fry mark-composes
{ _ } split convert-curries
[ [ [ ] ] [ [ ] (make-curry) but-last ] if-zero ]
- [ spread>quot swap [ [ ] (make-curry) compose ] unless-zero ] if-empty ;
+ [ spread>quot-shallow swap [ [ ] (make-curry) compose ] unless-zero ] if-empty ;
DEFER: dredge-fry
superclasses [ "slots" word-prop length ] map-sum ;
: boa-check-quot ( class -- quot )
- all-slots [ class>> instance-check-quot ] map spread>quot
+ all-slots [ class>> instance-check-quot ] map spread>quot-shallow
f like ;
: define-boa-check ( class -- )
USING: alien strings kernel math tools.test io prettyprint
namespaces combinators words classes sequences accessors
-math.functions arrays combinators.private ;
+math.functions arrays combinators.private stack-checker ;
IN: combinators.tests
[ 3 ] [ 1 2 [ + ] call( x y -- z ) ] unit-test
[ "nachos" ] [ 33 test-case-12 ] unit-test
[ "nachos" ] [ 33 \ test-case-12 def>> call ] unit-test
+
+[ (( x x -- x x )) ] [
+ [ { [ ] [ ] } spread ] infer
+] unit-test
[ [ 3keep ] curry ] map concat [ 3drop ] append [ ] like ;
! spread
-: spread>quot ( seq -- quot )
+: spread>quot-shallow ( seq -- quot )
[ ] [ [ dup empty? [ [ dip ] curry ] unless ] dip append ] reduce ;
+: spread>quot ( seq -- quot )
+ [ ] [ [ [ dip ] curry ] dip append ] reduce ;
+
: spread ( objs... seq -- )
spread>quot call ;