(let* ((field (slot-or-lose type slot))
(offset (alien-record-field-offset field))
(field-type (alien-record-field-type field)))
(let* ((field (slot-or-lose type slot))
(offset (alien-record-field-offset field))
(field-type (alien-record-field-type field)))
(type list indices)
(optimize (inhibit-warnings 3)))
(multiple-value-bind (target-type offset) (deref-guts alien indices)
(type list indices)
(optimize (inhibit-warnings 3)))
(multiple-value-bind (target-type offset) (deref-guts alien indices)
(optimize (inhibit-warnings 3)))
(if (or (alien-pointer-type-p target-type)
(alien-array-type-p target-type)
(optimize (inhibit-warnings 3)))
(if (or (alien-pointer-type-p target-type)
(alien-array-type-p target-type)
(let ((alien-type (alien-value-type alien)))
(if (or (alien-pointer-type-p alien-type)
(alien-array-type-p alien-type)
(let ((alien-type (alien-value-type alien)))
(if (or (alien-pointer-type-p alien-type)
(alien-array-type-p alien-type)
(naturalize (alien-value-sap alien) target-type)
(error "~S cannot be casted." alien)))
(error "cannot cast to alien type ~S" (unparse-alien-type target-type))))
(naturalize (alien-value-sap alien) target-type)
(error "~S cannot be casted." alien)))
(error "cannot cast to alien type ~S" (unparse-alien-type target-type))))
`(lambda (,fun ,@parms)
(declare (type (alien ,type) ,fun))
(alien-funcall ,fun ,@parms)))))
`(lambda (,fun ,@parms)
(declare (type (alien ,type) ,fun))
(alien-funcall ,fun ,@parms)))))
;; anyway, and (2) such a declamation can be (especially for
;; alien values) both messy to do by hand and very important
;; for performance of later code which uses the return value.
;; anyway, and (2) such a declamation can be (especially for
;; alien values) both messy to do by hand and very important
;; for performance of later code which uses the return value.