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 key values bug #465

Open
hemml opened this issue Jan 3, 2023 · 1 comment
Open

default key values bug #465

hemml opened this issue Jan 3, 2023 · 1 comment

Comments

@hemml
Copy link
Contributor

hemml commented Jan 3, 2023

SBCL:

(defun test (x y z)
  (funcall
    (lambda (&key (x x) (y y) (z z))
      (format t "X: ~A, Y: ~A, Z: ~A~%" x y z))
    :x 'x1))
(test 'x 'y 'z)
X: X1, Y: Y, Z: Z

In JSCL:

(defun test (x y z) 
...   (funcall 
...     (lambda (&key (x x) (y y) (z z)) 
...       (format t "X: ~A, Y: ~A, Z: ~A~%" x y z)) 
...     :x 'x1))
TEST
CL-USER> (test 'x 'y 'z)
X: X1, Y: #<JS-OBJECT undefined>, Z: #<JS-OBJECT undefined>

but the following code works:

(defun test (x1 y1 z1) 
...   (funcall 
...     (lambda (&key (x x1) (y y1) (z z1)) 
...       (format t "X: ~A, Y: ~A, Z: ~A~%" x y z)) 
...     :x 'x1))
CL-USER> (test 'x 'y 'z)
X: X1, Y: Y, Z: Z 
@vlad-km
Copy link
Member

vlad-km commented Jan 3, 2023

now is called on the stage equwal
he knows exactly how that mistakes to correct

wbr
@vlad-km

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