Merge branch 'master' of git://factorcode.org/git/factor
commit
ab408a436d
|
@ -3,7 +3,7 @@ kernel math namespaces parser prettyprint sequences strings
|
||||||
tools.test vectors words quotations classes classes.algebra
|
tools.test vectors words quotations classes classes.algebra
|
||||||
classes.private classes.union classes.mixin classes.predicate
|
classes.private classes.union classes.mixin classes.predicate
|
||||||
vectors definitions source-files compiler.units growable
|
vectors definitions source-files compiler.units growable
|
||||||
random inference effects kernel.private sbufs math.order
|
random inference effects kernel.private sbufs math.order
|
||||||
classes.tuple ;
|
classes.tuple ;
|
||||||
IN: classes.algebra.tests
|
IN: classes.algebra.tests
|
||||||
|
|
||||||
|
@ -288,6 +288,8 @@ INTERSECTION: generic-class generic class ;
|
||||||
generic-class flatten-class
|
generic-class flatten-class
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
[ \ + flatten-class ] must-fail
|
||||||
|
|
||||||
INTERSECTION: empty-intersection ;
|
INTERSECTION: empty-intersection ;
|
||||||
|
|
||||||
[ t ] [ object empty-intersection class<= ] unit-test
|
[ t ] [ object empty-intersection class<= ] unit-test
|
||||||
|
|
|
@ -207,9 +207,6 @@ GENERIC: (flatten-class) ( class -- )
|
||||||
M: anonymous-union (flatten-class)
|
M: anonymous-union (flatten-class)
|
||||||
members>> [ (flatten-class) ] each ;
|
members>> [ (flatten-class) ] each ;
|
||||||
|
|
||||||
M: word (flatten-class)
|
|
||||||
normalize-class (flatten-class) ;
|
|
||||||
|
|
||||||
: flatten-class ( class -- assoc )
|
: flatten-class ( class -- assoc )
|
||||||
[ (flatten-class) ] H{ } make-assoc ;
|
[ (flatten-class) ] H{ } make-assoc ;
|
||||||
|
|
||||||
|
|
|
@ -31,3 +31,6 @@ M: intersection-class rank-class drop 2 ;
|
||||||
|
|
||||||
M: intersection-class instance?
|
M: intersection-class instance?
|
||||||
"participants" word-prop [ instance? ] with all? ;
|
"participants" word-prop [ instance? ] with all? ;
|
||||||
|
|
||||||
|
M: intersection-class (flatten-class)
|
||||||
|
participants <anonymous-intersection> (flatten-class) ;
|
||||||
|
|
|
@ -32,3 +32,6 @@ M: union-class rank-class drop 2 ;
|
||||||
|
|
||||||
M: union-class instance?
|
M: union-class instance?
|
||||||
"members" word-prop [ instance? ] with contains? ;
|
"members" word-prop [ instance? ] with contains? ;
|
||||||
|
|
||||||
|
M: union-class (flatten-class)
|
||||||
|
members <anonymous-union> (flatten-class) ;
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespaces continuations layouts accessors ;
|
||||||
|
|
||||||
[ ] [ "tetris" shake-and-bake ] unit-test
|
[ ] [ "tetris" shake-and-bake ] unit-test
|
||||||
|
|
||||||
[ t ] [ 1200000 small-enough? ] unit-test
|
[ t ] [ 1500000 small-enough? ] unit-test
|
||||||
|
|
||||||
[ ] [ "bunny" shake-and-bake ] unit-test
|
[ ] [ "bunny" shake-and-bake ] unit-test
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue