;; These functions are side-effect-free except for the
;; behaviour of functions passed as argument.
mapcar mapcan mapconcat
- assoc plist-get plist-member
+ assoc assoc-string plist-get plist-member
;; It's safe to ignore the value of `sort' and `nreverse'
;; when used on arrays, but most calls pass lists.
Compare keys with TEST. Defaults to `equal'.
Return the modified alist.
Elements of ALIST that are not conses are ignored."
+ (declare (important-return-value t))
(unless test (setq test #'equal))
(while (and (consp (car alist))
(funcall test (caar alist) key))
"Delete from ALIST all elements whose car is `eq' to KEY.
Return the modified alist.
Elements of ALIST that are not conses are ignored."
+ (declare (important-return-value t))
(assoc-delete-all key alist #'eq))
(defun rassq-delete-all (value alist)
"Delete from ALIST all elements whose cdr is `eq' to VALUE.
Return the modified alist.
Elements of ALIST that are not conses are ignored."
+ (declare (important-return-value t))
(while (and (consp (car alist))
(eq (cdr (car alist)) value))
(setq alist (cdr alist)))
(setf (alist-get \\='b foo nil \\='remove) nil)
foo => ((a . 1))"
+ (declare (important-return-value t))
(ignore remove) ;;Silence byte-compiler.
(let ((x (if (not testfn)
(assq key alist)