Skip to content

Toplevel closures in Medley Common Lisp -- documentation and bug fix too #2051

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

Open
2 tasks
masinter opened this issue Feb 28, 2025 · 0 comments
Open
2 tasks

Comments

@masinter
Copy link
Member

Toplevel closures "work" in Medley Interlisp in that you can write

(let ((x 10)) #'(lambda () (incf x)))

and get back an interpreted closure, or if you have a non-managed file (not using fileCOMS or other means of saving state), you can compile file it.

But lexical closures don't have a way of saving state using the file manager commands defined.

  • this limitation should be documented under "things you can't do when using the file manager".
  • The specific use case of a lexial closure inside a DEFUN currently yields an error. It shouldn't. Perhaps a warning is called for but
(let ((x 10)) (defun foo () (incf x)))

shouldn't error.

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

No branches or pull requests

1 participant