 : check-superclass ( superclass -- )
     dup valid-superclass? [ bad-superclass ] unless drop ;
 
+GENERIC# (define-tuple-class) 2 ( class superclass slots -- )
+
 PRIVATE>
 
-GENERIC# define-tuple-class 2 ( class superclass slots -- )
-
-M: word define-tuple-class
+: define-tuple-class ( class superclass slots -- )
     over check-superclass
+    make-slots over class-size 2 + finalize-slots
+    (define-tuple-class) ;
+
+M: word (define-tuple-class)
     define-new-tuple-class ;
 
-M: tuple-class define-tuple-class
-    over check-superclass
+M: tuple-class (define-tuple-class)
     3dup tuple-class-unchanged?
     [ 3drop ] [ redefine-tuple-class ] if ;
 

    } cleave ;

: define-new-tuple-class ( class superclass slots -- )
    make-slots
    [ drop f f tuple-class define-class ]
    [ nip "slots" set-word-prop ]
    [ 2drop update-classes ]

: define-tuple-prototype ( class -- )
    dup tuple-prototype "prototype" set-word-prop ;

: define-tuple-slots ( class -- )
    dup "slots" word-prop define-accessors ;

: make-tuple-layout ( class -- layout )
    [ ]
    [ [ superclass class-size ] [ "slots" word-prop length ] bi + ]
    [ superclasses dup length 1- ] tri
    <tuple-layout> ;

