Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最好用一个例子来解释我正在尝试什么。
给定一个集合 ["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"
interpose如果你想要一个序列,或者clojure.string/join你只想要字符串结果,你可以使用这个函数。
interpose
clojure.string/join