Port tools.reader to Clojurescript

Description

As part of the effort to get the Clojurescript compiler bootstrapped,
this is a patch porting org.clojure/tools.reader to clojurescript.

The port follows the Clojure implementation quite closely, except in the case of:

  • Numbers: all numbers are reduced to js/Number

  • Chars: reduced to string as in Clojurescript

  • Macros: only used to compile in/out features (not) available in cljs builds

  • There is no `(defn read [] ...)` zero arity implementation as we don't have `in`

  • Custom implementation of clojure.lang.RT/nextID using an atom

  • Run tests using: `lein cljsbuild test`

Contributors: Andrew Mcveigh, Jonathan Boston, Nicola Mometto and Thomas G. Kristensen

Environment

None

Activity

Show:
Nicola Mometto
June 9, 2015, 11:06 AM

Andrew, thanks a lot. Can you please attach a patch created with `git format patch`? This is what clojure requires, to track authorship: http://dev.clojure.org/display/community/Creating+Tickets

It will need to be a single commit. You can use a `Also-by:` field to share authorship

Andrew Mcveigh
June 9, 2015, 11:34 AM

Resubmit patch in required format

Nicola Mometto
June 9, 2015, 1:03 PM

Pushed with a couple of changes, most notably it depends on cljs >=3308 rather than trying to backport.

Andrew Mcveigh
June 9, 2015, 1:08 PM

Ah, good. I was a bit uncomfortable about the version check macros being there, but decided to take the lead of the Clojure version.

Nicola Mometto
June 9, 2015, 1:18 PM

cljs is a moving target and updates much frequently then clj, no interest in keeping compatibility with older versions (cljs itself depends on clj 1.7.0-rc1)

Completed

Assignee

Nicola Mometto

Reporter

Andrew Mcveigh

Labels

Approval

None

Patch

Code and Test

Priority

Major