Thanks Maria.
It works fine.
What is the level of support for macros?
I tried to eval/compile with custom macros but it didn't work:
*(defmacro my [n]*
* n)*
*(macroexpand '(my 3)) *
eval returns: (my 3)
compile returns: cljs.user.my = (function
cljs$user$my(_AMPERSAND_form,_AMPERSAND_env,n){ return n; });
cljs.user.my.cljs$lang$macro = true; cljs.core.list(new
cljs.core.Symbol(null,"my","my",584828258,null),3);
So I tried to run macroexpand on a clojure macro (macroexpand '(and 3 4))
It works:
eval returns:
(let* [and__19224__auto__ 3] (if and__19224__auto__ (cljs.core$macros/and
4) and__19224__auto__))
compile returns:
cljs.core.list(new cljs.core.Symbol(null,"let*","let*",1920721458,null),new
cljs.core.PersistentVector(null, 2, 5,
cljs.core.PersistentVector.EMPTY_NODE, [new
cljs.core.Symbol(null,"and__19224__auto__","and__19224__auto__",-1924552325,null),3],
null),cljs.core.list(new
cljs.core.Symbol(null,"if","if",1181717262,null),new
cljs.core.Symbol(null,"and__19224__auto__","and__19224__auto__",-1924552325,null),cljs.core.list(new
cljs.core.Symbol("cljs.core$macros","and","cljs.core$macros/and",48320334,null),4),new
cljs.core.Symbol(null,"and__19224__auto__","and__19224__auto__",-1924552325,null)));
On Mon, Nov 23, 2015 at 7:34 AM, Maria Geller <[email protected]>
wrote:
> For evaluating ClojureScript in ClojureScript you need to use the cljs.js
> namespace (
> https://github.com/cljsinfo/cljs-api-docs/blob/catalog/refs/library/cljs.js.md).
> Here is a gist with a small example:
> https://gist.github.com/mneise/36c0bbae83b19c056781
>
> On Sunday, November 22, 2015 at 11:19:29 AM UTC-5, Yehonathan Sharvit
> wrote:
> > Following this (great) talk by
> https://www.youtube.com/watch?v=Elg17s_nwDg
> > I tried to comile cljs in cljs.
> >
> > 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
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/clojurescript.
>
--
"Are we what we become or do we become what we are?" - Prof. Beno Gross
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.