Skip to content
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

Default make-method-lambda doesn't add implicit blocks around the method body. #15

Closed
marcoheisig opened this issue Apr 7, 2020 · 5 comments

Comments

@marcoheisig
Copy link
Contributor

The following code signals "Error: return for unknown block: foo".

(in-package #:closer-common-lisp)

(defclass gf (standard-generic-function)
  ()
  (:metaclass funcallable-standard-class))

(defgeneric foo (x)
  (:generic-function-class gf))

;; This method on MAKE-METHOD-LAMBDA is necessary to suppress the default
;; expansion DEFMETHOD and use the expander from CLOSER-MOP instead.
(defmethod make-method-lambda :before ((gf gf) method lambda env)
  (declare (ignore gf method lambda env)))

(defmethod foo ((x integer))
  (return-from foo x))

It seems closer-mop's expansion of make-method-lambda doesn't add the necessary implicit blocks around the method function body.

@pcostanza
Copy link
Owner

Thanks a lot for reporting this. I will look into this, but cannot promise that I can react fast at the moment. (Maybe, maybe not.) As a temporary workaround, can you create the necessary block manually in the user code until this is fixed?

@marcoheisig
Copy link
Contributor Author

I can even offer to make a pull request myself. That shouldn't be too much work...

@marcoheisig marcoheisig changed the title Defalt make-method-lambda doesn't add implicit blocks around the method body. Default make-method-lambda doesn't add implicit blocks around the method body. Apr 7, 2020
@marcoheisig
Copy link
Contributor Author

OK, I just submitted a pull request.

@pcostanza
Copy link
Owner

Quick note: Sorry for the delay in working on this. There are several reasons: The COVID-19 situation caused some delay (nothing to worry about, no serious issues). Also, since I moved my system to macOS Mojave, I can't run 32-bit apps anymore, which means I can't easily test Allegro Common Lisp and CMUCL anymore. Franz haven't responded to a request for a 64-bit "express" or evaluation version. I will now try to set up a 32-bit Linux system to be able to test ACL and CMUCL. And then ECL got a new version, which seems to have introduced one or two new CLOS MOP bugs and make ContextL and AspectL fail. And I haven't tested the new ABCL yet... So lots of work.

I hope your issue isn't urgent. If so, please let me know, so I can try to prioritize it.

@marcoheisig
Copy link
Contributor Author

Thanks for keeping me up to date. The issue isn't urgent - I fixed it in my local copy of closer-mop and that is enough to continue development. But I'd love to see a fix over the next year or so.

Stay healthy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants