New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restart for when methods are defined over functions or macros, and when arglists don't match #54

Closed
wants to merge 1 commit into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+10 −5
Diff settings

Always

Just for now

restart for when methods are defined over functions or macros, and wh…

…en arglists don't match
  • Loading branch information...
alanruttenberg committed Jun 15, 2017
commit 7548151612417bb82ef3ee86a2d7670505b328bb
@@ -2190,8 +2190,12 @@ Initialized with the true value near the end of the file.")
(clrhash *make-instance-initargs-cache*)
(clrhash *reinitialize-instance-initargs-cache*))
(if gf
(check-method-lambda-list name method-lambda-list
(generic-function-lambda-list gf))
(restart-case
(check-method-lambda-list name method-lambda-list
(generic-function-lambda-list gf))
(unbind-and-try-again () :report (lambda(s) (format s "Undefine generic function #'~a and continue" name))
(fmakunbound name)
(setf gf (ensure-generic-function name :lambda-list method-lambda-list))))
(setf gf (ensure-generic-function name :lambda-list method-lambda-list)))
(let ((method
(if (eq (generic-function-method-class gf) +the-standard-method-class+)
@@ -4549,9 +4553,10 @@ or T when any keyword is acceptable due to presence of
(eq 'setf (first function-name))
(autoload-ref-p (second function-name))))
(fmakunbound function-name)
(error 'program-error
:format-control "~A already names an ordinary function, macro, or special operator."
:format-arguments (list function-name))))
(progn
(cerror "Redefine as generic function" "~A already names an ordinary function, macro, or special operator." function-name)
(fmakunbound function-name)
)))
(apply (if (eq generic-function-class +the-standard-generic-function-class+)
#'make-instance-standard-generic-function
#'make-instance)
ProTip! Use n and p to navigate between commits in a pull request.