diff options
Diffstat (limited to 'Lisp/data-types.lisp')
-rw-r--r-- | Lisp/data-types.lisp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lisp/data-types.lisp b/Lisp/data-types.lisp index e244e8d..36f0f2f 100644 --- a/Lisp/data-types.lisp +++ b/Lisp/data-types.lisp @@ -39,6 +39,17 @@ :initform (cffi:null-pointer))))) + + +(defmethod make-load-form ((instance c-pointer-wrapper) &optional environment) + (declare (ignore environment)) + ;; (TYPE-OF INSTANCE) works because MAKE-POINTER-WRAPPER accepts + ;; subclasses of ID as well as ID itself. + `(make-pointer-wrapper ',(type-of instance) + :pointer (make-pointer + ,(pointer-address (pointer-to instance))))) + + ;; The following may be needed by some implementations (namely Allegro ;; CL). (eval-when (:compile-toplevel :load-toplevel :execute) @@ -106,6 +117,13 @@ The following calls are all equivalent: (apply #'invoke-by-name receiver selector args)))) +(defmethod make-load-form ((selector selector) &optional environment) + (declare (ignore environment)) + `(make-pointer-wrapper 'selector + :pointer (make-pointer + ,(pointer-address (pointer-to selector))))) + + (defclass id (c-pointer-wrapper) () (:documentation "The type of all Objective-C objects. |