The :context basically tells the compiler if the return value is required
(:statement vs. :expr). A :statement does not need to return something and "if"
in javascript does not return something.
If an "if" is compiled with :expr it generates (condition ? yes : no) instead
of "if" for :statement.
The compiler assumes :statement as the default for the top-level but when
working with a REPL that is not the case since you want the result, so :expr
must be set. The standard cljs repl wraps everything in a pr-str so that
problem does not show there.
Hope that made sense, but no it is not a bug.
Cheers,
/thomas
On Tuesday, April 26, 2016 at 4:07:12 PM UTC+2, J David Eisenberg wrote:
> Sorry for the bad netiquette of responding to one's own post, but I am
> wondering if the compile in the condition that doesn't use {:content :expr}
> is a bug rather than something that should be expected.
--
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 https://groups.google.com/group/clojurescript.