-
Notifications
You must be signed in to change notification settings - Fork 14
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
Provide pre-configured agent for alists and plists #35
Comments
The agent for those two could be generic. Both functions |
For plist, you can use `remf`:
(let ((p '(:foo 17 :bar 18)))
(remf p :bar)
p)
For alist, I don't know if there is something better then `delete`:
(let ((a '((foo . 17) (bar 18))))
(setf a (delete 'foo a :key #'first))
a)
Or, with Alexandria:
(let ((a '((foo . 17) (bar 18))))
(alexandria:deletef a 'foo :key #'first)
a)
|
I think an acceptable interface would be to allow |
Can you explain your rationale?
|
What I mean is that the removal (mostly |
`remf` could be abstracted to handle plists and alists the same way.
generic-cl has `erase`.
|
Yeah. I think that would make sense here. |
As for #34, it would make sense to unify the 2 data structure agents considering how similar they are.
But the CL standard uses different APIs for the two:
assoc
for alists andgetf
for plists.If we are going to follow CL, then we can make serarate agents.
If not, we can unify the interfaces. But then, why not unify the plist/alist interface with that of hash-tables?
The text was updated successfully, but these errors were encountered: