- (declare (type (sb-alien:alien (* ,alien-type)) alien)
- (type (or null ,name) instance))
- (unless instance
- (setf instance (make-instance ',name)))
- ,@(loop for slotd in slots
- ;; FIXME: slotds in source are more complicated in general
- ;;
- ;; FIXME: baroque construction of intricate fragility
- for array-length = (getf (cdr slotd) :array-length)
- if array-length
- collect `(progn
- (let ((array (make-array ,array-length)))
- (setf (slot-value instance ',(car slotd))
- array)
- (dotimes (i ,array-length)
- (setf (aref array i)
- (sb-alien:deref
- (sb-alien:slot alien ',(car slotd))
- i)))))
- else
- collect `(setf (slot-value instance ',(car slotd))
- (sb-alien:slot alien ',(car slotd))))
- instance)
+ (declare (type (sb-alien:alien (* ,alien-type)) alien)
+ (type (or null ,name) instance))
+ (unless instance
+ (setf instance (make-instance ',name)))
+ ,@(loop for slotd in slots
+ ;; FIXME: slotds in source are more complicated in general
+ ;;
+ ;; FIXME: baroque construction of intricate fragility
+ for array-length = (getf (cdr slotd) :array-length)
+ if array-length
+ collect `(progn
+ (let ((array (make-array ,array-length)))
+ (setf (slot-value instance ',(car slotd))
+ array)
+ (dotimes (i ,array-length)
+ (setf (aref array i)
+ (sb-alien:deref
+ (sb-alien:slot alien ',(car slotd))
+ i)))))
+ else
+ collect `(setf (slot-value instance ',(car slotd))
+ (sb-alien:slot alien ',(car slotd))))
+ instance)