diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-03 17:46:03 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-03 17:46:03 +0100 |
commit | e49008a9a4b7d9a0ab7e31f2ff53ff4e497b8d0b (patch) | |
tree | afe51478c572562b787ccaf2aa29f82ad1a94a83 /Lisp | |
parent | 2e26057818b48da27a5355e2d2101cb8605b840f (diff) |
Introduce function INTERN-CALLBACK-NAME.
darcs-hash:5f2cb0e84fcace08fc832adaf3e48728fd76356c
Diffstat (limited to 'Lisp')
-rw-r--r-- | Lisp/method-definition.lisp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Lisp/method-definition.lisp b/Lisp/method-definition.lisp index b4ba605..a3ebaef 100644 --- a/Lisp/method-definition.lisp +++ b/Lisp/method-definition.lisp @@ -75,6 +75,20 @@ ,@body))))))) +(defvar *callback-names* (make-hash-table :test #'eql)) + +(defun intern-callback-name (method) + (or (gethash method *callback-names* nil) + (setf (gethash method *callback-names* nil) + (intern (format nil "~A (~A)" + (generic-function-name + (method-generic-function method)) + (sort (copy-list (method-qualifiers method)) + #'string< + :key #'string)) + '#:objective-cl)))) + + (defmethod add-method :after ((gf objective-c-generic-function) (method objective-c-method)) ;; FIXME: Support &REST arguments. @@ -90,7 +104,7 @@ (return-typestring (print-typespec-to-string return-type)) (arg-typestrings (mapcar #'print-typespec-to-string argument-types)) - (callback-name (gensym (selector-name method-name))) + (callback-name (intern-callback-name method)) (arg-symbols (mapcar #'(lambda (x) (declare (ignore x)) (gensym "ARG")) |