Browse files

blind: add *alias-map*

  • Loading branch information...
1 parent 282fced commit e74817c765c2bc7924d703fea5c7ac73357e5080 @Bronsa Bronsa committed Dec 29, 2012
Showing with 5 additions and 1 deletion.
  1. +2 −0
  2. +3 −1 src/blind/reader.clj
@@ -40,6 +40,8 @@ There are small differences from clojure's
`blind.reader/read` is capable of reading literal tags contaning periods, fixing #CLJ-1100
+`blind.reader/read` checks if `blind.reader/*alias-map*` is bound, if that's the case, aliases will be resolved by querying it (must be a map), otherwhise (ns-aliases *ns*) will be used
`blind.reader/read-line` has an additional arity with which is possible to specify the reader to read from
## License
@@ -505,8 +505,10 @@
(symbol (p 0) (p 1)))
(reader-error rdr "Invalid token: " token)))))
+(def ^:dynamic *alias-map* nil)
(defn- resolve-ns [sym]
- (or ((ns-aliases *ns*) sym)
+ (or ((or *alias-map*
+ (ns-aliases *ns*)) sym)
(find-ns sym)))
(defn read-keyword

0 comments on commit e74817c

Please sign in to comment.