Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Declined
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:1.2 on Snow Leopard
-
Approval:Not Approved
Description
The docs of read-json-from promise eof-error? and eof-value, but these fail to work. This is caused by lines 116-121: https://github.com/richhickey/clojure-contrib/blob/master/src/main/clojure/clojure/contrib/json.clj#L116-121
At EOF read returns -1, but evaluating (char -1) on the repl reveals that this does not work, and thus an exception is raised before eof-value could be returned.
This is easily fixed by checking if i is in a valid range, or at least not -1, by doing something like (and (not= i -1) (char i))