 
 M: mixin-class rank-class drop 3 ;
 
-: redefine-mixin-class ( class members -- )
-    [ (define-union-class) ]
-    [ drop t "mixin" set-word-prop ]
-    2bi ;
-
-: define-mixin-class ( class -- )
-    dup mixin-class? [
-        drop
-    ] [
-        {
-            [ { } redefine-mixin-class ]
-            [ H{ } clone "instances" set-word-prop ]
-            [ changed-definition ]
-            [ update-classes ]
-        } cleave
-    ] if ;
-
 TUPLE: check-mixin-class class ;
 
 : check-mixin-class ( mixin -- mixin )
     dup mixin-class? [
         \ check-mixin-class boa throw
     ] unless ;
+
+<PRIVATE
+
+: redefine-mixin-class ( class members -- )
+    [ (define-union-class) ]
+    [ drop t "mixin" set-word-prop ]
+    2bi ;
 
 : if-mixin-member? ( class mixin true false -- )
     [ check-mixin-class 2dup members member-eq? ] 2dip if ; inline


C: <mixin-instance> mixin-instance

: >mixin-instance< ( mixin-instance -- class mixin )
    [ class>> ] [ mixin>> ] bi ; inline

M: mixin-instance where >mixin-instance< "instances" word-prop at ;


        [ 2nip [ update-class ] each ]
    } 3cleave ;

: (remove-mixin-instance) ( class mixin -- )
    #! Call update-methods after removing the member:
    #! - Call sites of generics specializing on 'mixin'
