Fork me on GitHub
#cljs-dev
<
2016-02-22
>
richiardiandrea19:02:30

I have a problem in replumb and I don't understand what it is meant to accomplish

richiardiandrea19:02:16

it is a (defn ^:dynamic resolve-symbol that throws, is it meant to be bound explicitly for bootstrapped?

richiardiandrea19:02:23

maybe my "connazionale" @bronsa can help me here (I apologize for summoning simple_smile )

bronsa19:02:56

@richiardiandrea: the cljs version of tools.reader doesn't provide a default resolve-symbol because it's meaningless (there's no runtime support for namespaces in cljs), so it's left to the users of tools.reader to bind it

mfikes19:02:12

@richiardiandrea: it isn't re-bound in that unit test.

richiardiandrea19:02:13

perfect, that's what I suspected

richiardiandrea19:02:20

Maybe (binding [reader/resolve-symbol cljs.analyzer/resolve-symbol] ... is what we need? I am trying

mfikes19:02:25

@richiardiandrea: I think your unit tests reflect the way things worked prior to syntax-quote working. Now that http://dev.clojure.org/jira/browse/TRDR-33 is in the dependency used by ClojureScript, those tests will need to be updated.

mfikes19:02:15

@richiardiandrea: For example,

`x
used to incorrectly yield
x

richiardiandrea19:02:21

@mfikes thanks I am checking

richiardiandrea19:02:06

mmm the problem here looks it is the :dynamic part not rebound/set ... the espression `x in replumb throws as well now

richiardiandrea19:02:47

because I am using tools.reader/read-string and I need to set tools.reader/resolve-symbol

richiardiandrea20:02:25

@bronsa: Just wanted to confirm that custom binding tools.reader/resolve-symbol solves the problem and the only difference is the bug solved in TRDR-33:

FAIL in (macros) (:)
Executing (defmacro hello ..) as function should return (inc 13)
expected: (= "(inc 13)" out)
  actual: (not (= "(inc 13)" "(cljs.core/inc 13)"))
(foo.core/hello (+ 2 3))
(hello (+ 2 3))