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

Add predefined function del/1 on dict with some minimal tests #1348

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

Conversation

esad
Copy link

@esad esad commented Feb 26, 2025

This may need more work, but I just wanted to post this PR for discussion and see if this is something others may find useful. While working with dictionary based data structures, I've come to rely on put(KeyPath, Value), but there is no "function" for deleting keys. This would add another predefined del consistent in naming with del_dict/4 that also accepts a keypath.

@JanWielemaker
Copy link
Member

Thanks. Makes sense. We could consider a del(Key,Value), where Value is unified with the current value. The code could be simplified using SSU (=>). And of course, we need documentation ...

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 this pull request may close these issues.

2 participants