我有一个关联列表如下:
(defparameter *experts2*
`(
;; direction
(:direction . ( (nn-direction-expert (process-signal) :number-of-neighbors 10)
(fn-direction-expert (process-signal) :number-of-neighbors 10) ))
;; evaluation
(:evaluation . (
;(avoid-line-crossing-evaluation-expert (process-signal))
(nn-single-evaluation-expert (candidate-point))
(fn-single-evaluation-expert (candidate-point))
;(nn-all-evaluation-expert (ranking))
))
;; coordination
(:coordination . (
;(ranking-process (candidate-point))
(action-process (candidate-point ranking))))))
我正在寻找一种方法,从 key=>value 列表中提取值并将它们放入一个新列表中,例如
(defparameter *experts*
`(
;; direction
(nn-direction-expert (process-signal) :number-of-neighbors 10)
(fn-direction-expert (process-signal) :number-of-neighbors 10)
;eher als evaluationsexperte
;(avoid-line-crossing-evaluation-expert (process-signal) )
;; evaluation
(nn-single-evaluation-expert (candidate-point))
(fn-single-evaluation-expert (candidate-point))
;(nn-all-evaluation-expert (ranking))
;; coordination
;(ranking-process (candidate-point))
(action-process (candidate-point ranking))
))
有什么建议吗?感谢您的帮助。
问候
最佳答案
这似乎产生了你想要的答案,但它看起来不是很漂亮:
(mapcan #'copy-list (mapcar #'cdr *experts2*))
关于list - Common Lisp 从列表中返回关联作为新列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14407812/