Skip to content

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