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

Provide pre-configured agent for alists and plists #35

Open
Ambrevar opened this issue Jul 10, 2021 · 7 comments
Open

Provide pre-configured agent for alists and plists #35

Ambrevar opened this issue Jul 10, 2021 · 7 comments

Comments

@Ambrevar
Copy link

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 and getf 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?

@mdbergmann
Copy link
Owner

The agent for those two could be generic. Both functions assoc and getf could be supported depending on whether the user uses the agent for a plist or alist.
I don't actually know, how are values removed from a/plist. Is there something like remhash or even clrhash?

@Ambrevar
Copy link
Author

Ambrevar commented Jul 10, 2021 via email

@mdbergmann
Copy link
Owner

I think an acceptable interface would be to allow agent-assoc and agent-getf with setf but only do a agent-dolist with a lambda where the user can arbitrarily use remf of remove-if, or delete or however we wants to delete or filter entries.

@Ambrevar
Copy link
Author

Ambrevar commented Jul 11, 2021 via email

@mdbergmann
Copy link
Owner

mdbergmann commented Jul 11, 2021

What I mean is that the removal (mostly delete) of entries in at least the alist seems combersome and I thought it should be done by the user that can choose between delete and deletef, etc.
But maybe it should still be considered and pre-configured for a simpler use.

@Ambrevar
Copy link
Author

Ambrevar commented Jul 11, 2021 via email

@mdbergmann
Copy link
Owner

remf could be abstracted to handle plists and alists the same way.

Yeah. I think that would make sense here.

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