簡體   English   中英

Clojure遍歷哈希映射列表

[英]Clojure Iterating over a list of hash maps

我從以下代碼中收到錯誤消息“不知道如何創建ISeq”。 誰能告訴我為什么這不是一個適當的順序?

(defn hash-map-list []                                                                                                                 
  (map (fn [component]                                                                                                                 
      {:name component})                                                                                                            
      '("Jim" "Bill" "Carrie")))                                                                                                      

(first hash-map-list)

謝謝你的幫助

您只是忘了調用函數:)

(first (hash-map-list))
{:name "Jim"}

hash-map-list是一個函數。 它不是哈希映射列表。 如果調用該函數,您的代碼將起作用。

(first (hash-map-list))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM