 ! class definition
 
 : struct-prototype ( class -- prototype )
-    [ heap-size <byte-array> ] [ new [ 2 set-slot ] keep ] bi ; ! [ "struct-slots" word-prop ] tri
-    ! [ [ initial>> ] [ name>> setter-word ] bi over [ execute( struct value -- struct ) ] [ 2drop ] if ] each ;
+    [ heap-size <byte-array> ]
+    [ tuple-layout <tuple> [ 2 set-slot ] keep ]
+    [ "struct-slots" word-prop ] tri
+    [
+        [ initial>> ]
+        [ (writer-quot) ] bi
+        over [ swapd [ call( value struct -- ) ] curry keep ] [ 2drop ] if
+    ] each ;
 
 : (define-struct-class) ( class slots size align -- )
     [

    [ class>> c-type-getter-boxer ]
    [ offset>> [ >c-ptr ] swap suffix ] bi prepend ;

M: struct-class writer-quot
    nip
    [ class>> c-setter ]
    [ offset>> [ >c-ptr ] swap suffix ] bi prepend ;

! Struct as c-type



M: struct-class new
    dup "prototype" word-prop
    [ >c-ptr clone swap memory>struct ] [ <struct> ] if* ; inline

! Struct slot accessors

