Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

blind: add *alias-map*

  • Loading branch information...
commit e74817c765c2bc7924d703fea5c7ac73357e5080 1 parent 282fced
@Bronsa Bronsa authored
Showing with 5 additions and 1 deletion.
  1. +2 −0  README.md
  2. +3 −1 src/blind/reader.clj
View
2  README.md
@@ -40,6 +40,8 @@ There are small differences from clojure's LispReader.java:
`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
View
4 src/blind/reader.clj
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.