Skip to content

Commit

Permalink
Fix core.async companion namespace to deref resolved vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Aug 5, 2013
1 parent 700688c commit 789e346
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/clojure/clojure/core/typed/async.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
buffer
use buffer> (similar for other buffer constructors)
"}
clojure.core.typed.async
clojure.core.typed.async
(:require [clojure.core.typed :refer [ann ann-pdatatype def-alias ann-pprotocol inst
AnyInteger tc-ignore Seqable]
:as t])
Expand Down Expand Up @@ -111,14 +111,16 @@
;;;;;;;;;;;;;;;;;;;;
;; Typed wrappers

(t/tc-ignore
(defn ^:private v [vsym]
{:pre [(symbol? vsym)]
:post [(var? %)]}
(let [ns (find-ns (namespace vsym))
{:pre [(symbol? vsym)
(namespace vsym)]}
(let [ns (find-ns (symbol (namespace vsym)))
_ (assert ns (str "Cannot find namespace: " (namespace vsym)))
var (ns-resolve ns (name vsym))]
(assert var (str "Cannot find var: " vsym))
var))
var (ns-resolve ns (symbol (name vsym)))]
(assert (var? var) (str "Cannot find var: " vsym))
@var))
)

(defmacro go>
"Asynchronously executes the body, returning immediately to the
Expand Down

0 comments on commit 789e346

Please sign in to comment.