diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-11 17:34:57 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-11 17:34:57 +0100 |
commit | e75a694b028cd8f7e378929fe95dd6ca355b1051 (patch) | |
tree | 22f1c472216e1be744125674d3e687a6451f6801 /Lisp/data-types.lisp | |
parent | 38747051bbe8bf893363c99374118e237e252cb7 (diff) |
Specialise MAKE-LOAD-FORM for pointer wrappers.
darcs-hash:4a9e629e6e9a9e20d21c80c541e70b4b6a810645
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. |