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

(SETF GETF) is buggy #486

Closed
Gleefre opened this issue Jul 31, 2023 · 3 comments · Fixed by #487
Closed

(SETF GETF) is buggy #486

Gleefre opened this issue Jul 31, 2023 · 3 comments · Fixed by #487

Comments

@Gleefre
Copy link
Contributor

Gleefre commented Jul 31, 2023

(let ((x (list :a 10 :b 20)))
  (setf (getf x :b) 0)
  x)
; => (:B 0)
;; should be: (:A 10 :B 0)

It seems to be caused by this line:
https://github.com/jscl-project/jscl/blob/master/src/list.lisp#L482C1-L482C1

If I understand it correctly, it should be (return plist) instead.

@svantevonerichsen6906
Copy link

To be honest, the spec doesn't specify what setf of getf should return. The example shows it returning the value it set.

@Gleefre
Copy link
Contributor Author

Gleefre commented Jul 31, 2023

The problem is not in the return value of (SETF GETF) but in the side effect of discarding the property :A

@svantevonerichsen6906
Copy link

Ah, sorry, overlooked that you returned the plist. Very well, proceed ^^.

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

Successfully merging a pull request may close this issue.

2 participants