Summary
alist-lib alist-update!/default not useful for adding keys
Metadata
- Id: 58e4772a34669d7f6529d60792852cb31d89281f
- Trac id: 1276
- Type: defect
- Reporter: retroj
- Owner: klutometis
- Cc:
- Status: assigned
- Component: extensions
- Estimated difficulty:
- Resolution:
- Priority: minor
- Milestone: someday
- Version: 4.10.x
- Changetime: 2017-08-25 15:20:03 UTC
- Created: 2016-04-08 00:07:39 UTC
- Keywords: alist-lib
Description
I noticed that alist-update! and alist-update!/default in alist-lib have call signatures suggestive of being able to add keys to an alist (not just updating existing keys) because they accept a default OLD value if the given key is not found. However, both procedures have an unspecified return value, so it's not clear what the intent was for the case of adding new entries to the alist. If they don't return an updated reference to the head of the list, there is no way to add new entries, and it doesn't make sense to have a DEFAULT in the call signature.