對第一人稱問好的工作很好,爲什麼不說 - 你好對大家?如何在矢量上執行帶有副作用的功能?
(defpartial greeting [name] [:p.alert "Hello " name ", how are you?"]) (defn say-hello [name] (append $content (greeting name))) (defn say-hello-to-first-person [names] (say-hello (first names))) (defn say-hello-to-everyone [names] (map say-hello names)) (say-hello-to-first-person ["Chris" "Tom" "Jim" "Rocky"]) (say-hello-to-everyone ["Chris" "Tom" "Jim" "Rocky"])
請參閱'doall'和'dorun'函數。 'doseq'也許是你想要的。 – edbond