【发布时间】:2013-10-05 19:13:17
【问题描述】:
最好用一个例子来解释我正在尝试什么。
给定一个集合 ["apple" "orange" "banana"] 和连接字符串 "," 函数应该产生 "apple,orange,banana"
这是写这个函数的惯用方式吗?
user=> (defn my-concat[x st]
(str (first x) (apply str (map #(str st %) (rest x)))))
user=> (my-concat "abcd" "!")
"a!b!c!d"
【问题讨论】: