db4
Slava Pestov 2008-07-05 17:08:01 -05:00
parent 0f535da33f
commit a8b826e8ed
4 changed files with 9 additions and 4 deletions

View File

@ -3,7 +3,7 @@ kernel math namespaces parser prettyprint sequences strings
tools.test vectors words quotations classes classes.algebra
classes.private classes.union classes.mixin classes.predicate
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 ;
IN: classes.algebra.tests
@ -288,6 +288,8 @@ INTERSECTION: generic-class generic class ;
generic-class flatten-class
] unit-test
[ \ + flatten-class ] must-fail
INTERSECTION: empty-intersection ;
[ t ] [ object empty-intersection class<= ] unit-test

View File

@ -207,9 +207,6 @@ GENERIC: (flatten-class) ( class -- )
M: anonymous-union (flatten-class)
members>> [ (flatten-class) ] each ;
M: word (flatten-class)
normalize-class (flatten-class) ;
: flatten-class ( class -- assoc )
[ (flatten-class) ] H{ } make-assoc ;

View File

@ -31,3 +31,6 @@ M: intersection-class rank-class drop 2 ;
M: intersection-class instance?
"participants" word-prop [ instance? ] with all? ;
M: intersection-class (flatten-class)
participants <anonymous-intersection> (flatten-class) ;

View File

@ -32,3 +32,6 @@ M: union-class rank-class drop 2 ;
M: union-class instance?
"members" word-prop [ instance? ] with contains? ;
M: union-class (flatten-class)
members <anonymous-union> (flatten-class) ;