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

Emacs cl:lambda macro handles &KEY arguments incorrectly. #9

Open
j3pic opened this issue Apr 25, 2022 · 0 comments
Open

Emacs cl:lambda macro handles &KEY arguments incorrectly. #9

j3pic opened this issue Apr 25, 2022 · 0 comments

Comments

@j3pic
Copy link

j3pic commented Apr 25, 2022

In Common Lisp, if you write something like this and then don't use the keyword arguments, then the variables should be bound to NIL:

(cl:defun MAKE-PACKAGE (name &KEY NICKNAMES USE)
  (let ((package (make-vector 8 'PACKAGE))
        (use-packages (mapcar #'FIND-PACKAGE USE)))
    (aset package 1 (STRING name))                      ;name                                                                                            

Instead, cl:lambda initializes the NICKNAMES and USE variables to unbound, which results in a type error when (mapcar #'FIND-PACKAGE USE) is evaluated.

As a result of that, I can't load load-cl.el in Emacs 26.1. It looks like some post-processing is supposed to happen to transform unbound to nil, but for some reason the unbound value makes it through.

It looks like something is going wrong when parsing the lambda list. I couldn't understand what the code generated by the keyword-assignments macro is supposed to do, but functions like lambda-list-keys and lambda-list-keyword-defaults seem to return the correct values.

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

1 participant