[ ] [ [ class<= ] most ] map-reduce
] if-empty ;
-: flatten-class ( class -- assoc )
- [ (flatten-class) ] H{ } make ;
+: flatten-class ( class -- seq )
+ [ (flatten-class) ] { } make members ;
M: builtin-class instance? [ tag ] [ class>type ] bi* eq? ;
-M: builtin-class (flatten-class) dup ,, ;
+M: builtin-class (flatten-class) , ;
M: builtin-class (classes-intersect?) eq? ;
M: anonymous-intersection (flatten-class)
participants>> [ full-cover ] [
- [ flatten-class keys ]
+ [ flatten-class ]
[ intersect-flattened-classes ] map-reduce
- [ dup ,, ] each
+ %
] if-empty ;
M: anonymous-intersection class-name
M: tuple-class instance?
dup echelon-of layout-class-offset tuple-instance? ;
-M: tuple-class (flatten-class) dup ,, ;
+M: tuple-class (flatten-class) , ;
M: tuple-class (classes-intersect?)
{
drop f ;
: fast-union-mask ( class -- n )
- [ 0 ] dip flatten-class
- [ drop class>type 2^ bitor ] assoc-each ;
+ flatten-class 0 [ class>type 2^ bitor ] each ;
: empty-union-predicate-quot ( class -- quot )
drop [ drop f ] ;
] change-at ;
: flatten-method ( method class assoc -- )
- over flatten-class keys
- [ swap push-method ] 2with with each ;
+ over flatten-class [ swap push-method ] 2with with each ;
: flatten-methods ( assoc -- assoc' )
H{ } clone [ [ swapd flatten-method ] curry assoc-each ] keep ;