小编Rya*_*ung的帖子

什么`:-`在clojure的core.typed中意味着什么?

来自core.typed库的代码:-意味着什么?

(t/ann play-many [(ta/Chan RPSResult) t/Int -> (t/Map t/Any t/Any)])
(defn play-many
  "Play n matches from out-chan and report a summary of the results."
  [out-chan n]
  (t/loop [remaining :- t/Int, n                          ;; <======== This line
           results :- (t/Map PlayerName t/Int), {}]
    (if (zero? remaining)
      results
      (let [[m1 m2 winner] (a/<!! out-chan)]
        (assert m1)
        (assert m2)
        (assert winner)
        (recur (dec remaining)
               (merge-with + results {winner 1}))))))
Run Code Online (Sandbox Code Playgroud)

types clojure

8
推荐指数
2
解决办法
696
查看次数

标签 统计

clojure ×1

types ×1