[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Update assq-delete-all to support keys of string type
From: |
Stephen J. Turnbull |
Subject: |
Update assq-delete-all to support keys of string type |
Date: |
Wed, 13 May 2015 09:13:16 +0900 |
Kaushal writes:
> I wanted to use assq-delete-all to remove all elements in an alist whose
> car matched a string.
Aside: "assq" means to use the test `eq' when comparing keys. You
would name this function `assoc-delete-all' if you just want to permit
strings as well as symbols and numbers (as the suggestion to use
cl-remove does).
> (defun assq-delete-all-string (key-str alist)
In this version, where you restrict to string, I would name it
`string-assoc-delete-all' or `assoc-string-delete-all'.
I don't know if it makes sense to perpetuate the traditional names
with the availabilty of cl-lib.