1
我有一個函數從被調用的輸入流中讀取一個令牌(get-next-indicator stream indicator)並返回它。我正在嘗試使用它來構建地圖。從流鎖中讀取Clojure函數
但是,當我運行它時,它鎖定。如果我刪除了get-next-indicator函數中的一個,它確實起作用。 這兩個函數都試圖在同一時間讀取流是這樣的。這是什麼原因造成的?
(defn decode-map [ stream ]
(loop [result {}]
(let [c (char (.read stream))]
(if (= c \e)
result
(recur (assoc result (get-next-indicator stream (int c))
(get-next-indicator stream (int c))))))))
你是什麼意思的「鎖定」?是否有錯誤訊息? – Svante 2009-06-30 02:26:13