Permalink
Browse files

Added reader support for special symbols nil, true, false. Refs CLJS-47

  • Loading branch information...
1 parent 0268421 commit 4a2f49a255bd646e5c967f1921908b3eea922615 @fogus fogus committed Aug 4, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/cljs/cljs/reader.cljs
@@ -237,18 +237,17 @@ nil if the end of stream has been reached")
:default (recur (do (.append buffer ch) buffer) (read-char reader)))))
(def special-symbols
- {'nil nil
- 'true true
- 'false false})
+ {"nil" nil
+ "true" true
+ "false" false})
(defn read-symbol
[reader initch]
(let [token (read-token reader initch)]
(if (gstring/contains token "/")
(symbol (subs token 0 (.indexOf token "/"))
(subs (inc (.indexOf token "/")) (.length token)))
- (let [s (symbol token)]
- (s special-symbols s)))))
+ (get special-symbols token (symbol token)))))
(defn read-keyword
[reader initch]

0 comments on commit 4a2f49a

Please sign in to comment.