示例:
(setq foo '("f" "o" "o"))
(setq bar '("b" "a" "r"))
(setq foobar `(,foo . ,(list bar)))
;; Give me a normal list ( ("f" "o" "o") ("b" "a" "r") ) which is not what I want.
我想得到( ("f" "o" "o") . ("b" "a" "r") )
。怎么样?
答案 0 :(得分:2)
使用cons
获取虚线对:
(setq foo '("f" "o" "o"))
(setq bar '("b" "a" "r"))
(cons foo (list bar))
-> (("f" "o" "o") ("b" "a" "r"))
答案 1 :(得分:0)
可替换地,
(setq foobar `(,foo ,bar))
(memq foo foobar)
-> (("f" "o" "o") ("b" "a" "r"))