diff options
-rw-r--r-- | Lisp/data-types.lisp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Lisp/data-types.lisp b/Lisp/data-types.lisp index 0b5865d..ba98fc3 100644 --- a/Lisp/data-types.lisp +++ b/Lisp/data-types.lisp @@ -38,7 +38,8 @@ :initform (cffi:null-pointer)))) -(defclass selector (c-pointer-wrapper) () +(defclass selector (c2mop:funcallable-standard-object c-pointer-wrapper) () + (:metaclass c2mop:funcallable-standard-class) (:documentation "An Objective-C method selector. ## Description: @@ -55,6 +56,18 @@ Use __find-selector__ instead. __find-selector__")) +(defmethod shared-initialize :after ((selector selector) + slot-names + &rest initargs + &key + &allow-other-keys) + (declare (ignore slot-names initargs)) + (c2mop:set-funcallable-instance-function + selector + #'(lambda (receiver &rest args) + (apply #'invoke-by-name receiver selector args)))) + + (defclass id (c-pointer-wrapper) () (:documentation "An instance of an Objective-C class. |