Support reader conditionals

Description

The tools.namespace parser does not recognize reader conditionals.

refresh does not recognize files containing reader conditionals.

Patch calls read with :read-cond :allow. It checks for the presence of clojure.core/reader-conditional? to determine if reader conditionals (and the 2-argument arity of read) is supported.

The patch use the default platform feature, which should always be :clj since tools.namespace only runs under Clojure(JVM).

Sample project from original ticket: https://github.com/whodidthis/refresh-rc

Environment

None

Activity

Show:
import
May 13, 2015, 3:38 PM

Comment made by: lorddoig

Maybe the team don't agree but I'm not sure this is a bug - 1.7.0 hasn't landed yet.

In the interim those having problems can use this temporary fork, which is hardcoded to read :clj features.

import
May 21, 2015, 5:52 PM

Comment made by: magnars

Can confirm that using Sean's temporary fork seems to solve the issue.

Alex Miller
June 17, 2015, 3:37 AM

Someone else pinged me about this. Likely the read here needs to pass {:read-cond :allow} options to read (only on 1.7 as the options are an arity that was added in 1.7).

https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/parse.clj#L36

Stuart Sierra
June 19, 2015, 5:25 PM

Patch available to try as 0.2.11-SNAPSHOT or 0.2.11-20150619.155542-23

In Leiningen:

Stuart Sierra
June 19, 2015, 8:44 PM

Included in release 0.2.11

Completed

Assignee

Stuart Sierra

Reporter

Toni Helenius

Labels

None

Approval

None

Patch

Code and Test

Priority

Major