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