- (let ((type (g-boxed-foreign-info foreign-type)))
- (multiple-value-bind (actual-cstruct slots) (decide-native-type type proxy)
- (with-foreign-object (native-structure (generated-cstruct-name
- (var-structure-name
- (g-boxed-variant-cstruct-info-root type))))
- (iter (for slot in slots)
- (setf (foreign-slot-value native-structure actual-cstruct slot)
- (slot-value proxy slot)))
- (values (boxed-copy-fn type native-structure) proxy))))))
+ (let* ((type (g-boxed-foreign-info foreign-type))
+ (cstruct-description (decide-native-type type proxy)))
+ (with-foreign-object (native-structure (generated-cstruct-name
+ (var-structure-name
+ (g-boxed-variant-cstruct-info-root type))))
+ (copy-slots-to-native proxy native-structure cstruct-description)
+ (values (boxed-copy-fn type native-structure) proxy)))))