(setq fileset '(
(arch . ("a.txt" "b.txt" "c.txt" "d.txt" "e.txt"))
(emacs . ("f.txt" "g.txt"))
))
(cl-rassoc-if (lambda (el) (member "a.txt" (cdr el))) fileset)
我以为 cl-rassoc-if
结果会是 (arch . ("a.txt" "b.txt" "c.txt" "d.txt" "e.txt"))
, 结果是 nil
, 这是为啥?
cl-rassoc-if is an autoloaded byte-compiled Lisp function in
‘cl-seq.el’.
(cl-rassoc-if PREDICATE LIST [KEYWORD VALUE]...)
Find the first item whose cdr satisfies PREDICATE in LIST.
Keywords supported: :key
[back]
pred
接受的是不是 alist 中的元素,是元素的 cdr 部分
(setq fileset '((arch . ("a.txt" "b.txt" "c.txt" "d.txt" "e.txt"))
(emacs . ("f.txt" "g.txt"))))
(cl-rassoc-if (lambda (el) (member "a.txt" el)) fileset)
(arch "a.txt" "b.txt" "c.txt" "d.txt" "e.txt")