我有一个从函数返回的序列(foundApps),我想将一个函数映射到它的所有元素.由于某种原因,apply并count为sequnece工作,但map没有:
(apply println foundApps)
(map println rest foundApps)
(map (fn [app] (println app)) foundApps)
(println (str "Found " (count foundApps) " apps to delete"))))
Run Code Online (Sandbox Code Playgroud)
打印:
{:description another descr, :title apptwo, :owner jim, :appstoreid 1235, :kind App, :key #<Key App(2)>} {:description another descr, :title apptwo, :owner jim, :appstoreid 1235, :kind App, :key #<Key App(4)>}
Found 2 apps to delete for id 1235
Run Code Online (Sandbox Code Playgroud)
所以apply似乎很乐意为序列工作,但map事实并非如此.我在哪里傻?
clojure ×1