Clojure:是否可以将Concat与功能参数一起使用?

问题描述 投票:-1回答:1
(defn foo                                          
  [first]                      ;let's say first = '(I am a taco)

  (concat '(wierd) first)        ;I want to concat or add the word 'wierd to the words: I am a taco
)

我注意到,在进行连接时,我遇到了错误消息。我也尝试过cons函数,但这似乎没有做任何事情。我的问题是,您可以使用函数参数进行连接吗?如果是这样,建议对上述代码进行什么修复?

clojure concat cons
1个回答
0
投票
(defn foo [first] (concat '("wierd") first)) (foo '("I" "am" "a" "taco"))
© www.soinside.com 2019 - 2024. All rights reserved.