The following code didn't work
(->> (cljs.tools.reader/read-string "(inc 2)")
(cljs.analyzer/analyze {}))
I got a js error:
Uncaught #error {:message "Cannot read property 'findInternedVar' of null", :data {:tag :cljs/analysis-error}
Who could help?
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/5ZUvk7RPB9I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/5ZUvk7RPB9I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
One would be to put the macros in a namespace and use cljs.js to require that namespace as a macros namespace. This would involve using cljs.js/*load-fn* to provide the source in the macro namespace. Then you can subsequently use cljs.js to compile and evaluate code that makes use of those macros.
Another approach, if you are just looking to expand a macro is detailed in this post:
http://blog.fikesfarm.com/posts/2015-09-05-runtime-macroexpand.html
Hi, Maria!
I tried to eval clojurescript form in clojurescript via eval-str and it works for code without functions.
If i add 'defn' form then error occurs. I debugged it and first of all following thing is suspicious: during analyzing defn we are dispatched into core$macros.js functions where .core.cst$sym$cljs$core$macros_SLASH_fn is not defined but similar cljs.core.cst$sym$cljs$core_SLASH_fn symbol is defined in constants_table.js
Can you advice me where i can have a look to resolve my problem?
Thanks in advance
ps by the way can you explain me when core$macros.js and constants_table.js come to play during transpiling?
Hi, Maria!
I tried to eval clojurescript form in clojurescript via eval-str and it works for code without functions.
If i add 'defn' form then error occurs. I debugged it and first of all following thing is suspicious: during analyzing defn we are dispatched into core$macros.js functions where .core.cst$sym$cljs$core$macros_SLASH_fn is not defined but similar cljs.core.cst$sym$cljs$core_SLASH_fn symbol is defined in constants_table.js
Can you advice me where i can have a look to resolve my problem?
Thanks in advance
ps by the way can you explain me when core$macros.js and constants_table.js come to play during transpiling?
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.
Hi, Mike!
I am doing similar things:
(defn node-eval [{:keys [name source]}]
(js/eval source)
)
(defn add-code [code]
(def st (empty-state))
(eval-str st
; "(ns foo.bar)\n
; (print (rest [1 2 3]))"
; "(ns foo.bar)
; (print (+ 1 2))"
; "(ns foo.bar)
; (def x 1)
; (def y 2)
; (print x)
; (print y)
; (print (+ x y))"
"(defn my-func [x] (print x))"
'foo.bar
{:verbose true
:source-map true
:eval node-eval
;:load node-load
}
(fn [{:keys [error] :as res}]
(print "continuation")
(if error
(do
(println error)
(println (.. error -cause -stack)))
(println res))))
i am using clojurescript 1.7.228
I have following difference: i cant explicitly import cljs.core/js because of its circular dependency on cljs.core->cljs.core if my cljs file contains only require on cljs.core/js, i didnt resolve this compile time error and copy paste cljs.core/js.cljs content into my own executor.cljs.
Mike, thanks!
THe issue was with lein with auto mode watching file changes. I restarted lein and cicrular dependency gone. Now all works. Thanks!
Andrew
Andray
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/5ZUvk7RPB9I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.