medley icon indicating copy to clipboard operation
medley copied to clipboard

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

Open masinter opened this issue 10 months ago • 0 comments

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.

masinter avatar Feb 28 '25 20:02 masinter