说我有功能:
(defn foo [something & otherthings]
(println something)
(println otherthings))
评估
(foo "ack" "moo" "boo")
给了我:
ack
(moo boo)
如果我想用列表调用foo怎么办?
(foo "ack" (list "moo" "boo"))
并获取
ack
(moo boo)
而不是
ack
((moo boo))
有没有办法在不改变foo的情况下做到这一点?
答案 0 :(得分:8)
您想要apply
:
(apply foo "ack" (list "moo" "boo"))