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

[Needs discussion] Fix assoc :key behavior #450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Affonso-Gui
Copy link
Member

EusLisp have the non-standard behavior of applying assoc's :key argument on each form, instead of on each of its car values:

eus$ (assoc 3 '((1 . "one") (2 . "two") (3 . "three")) :key #'print)
(1 . "one")
(2 . "two")
(3 . "three")
;; nil

sbcl$ (assoc 3 '((1 . "one") (2 . "two") (3 . "three")) :key #'print)
1 
2 
3 
;; (3 . "three")

This PR implements the standard :key argument behavior in EusLisp as well.

eus$ (assoc 3 '((1 . "one") (2 . "two") (3 . "three")) :key #'print)
1
2
3
;; (3 . "three")

This is not backward compatible, but I am opening it because Inaba-sensei has pointed the EusLisp behavior as a bug (#436), granted that 'nobody is using this in code' and asked for a PR.
@inabajsk

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

Successfully merging this pull request may close these issues.

1 participant