Fork me on GitHub
#clojurescript
<
2016-10-08
>
adambrosio00:10:47

how can i print in a macro that is used from cljs without it being emitted as javascript?

crankyadmin06:10:27

Start the repl cider-jack-in-clojurescript

crankyadmin06:10:23

The default repl (the clojure) one can’t evaluate Clojurescript (well it probably could but its the wrong target).

gregnwosu08:10:30

cool thanks

C-c M-J

darwin08:10:38

@adambros you could write to System/out directly

darwin08:10:31

capture your output with with-out-str, and then print it there

moxaj13:10:20

Is such a function declaration illegal in clojurescript?

(defn foo
  ([x]
   (foo x :y 10))
  ([x & {:keys [y]}]
   (+ x y)))
My nodejs repl complains that "Cannot read property 'call' of undefined at Function.some.ns.foo.cljs$core$IFn$_invoke$arity$variadic".

henriklundahl13:10:27

No, it works fine in my ClojureScript REPL.

moxaj13:10:32

@henriklundahl alright, i'll investigate further, thanks!

adambrosio20:10:44

@darwin thanks, i even knew about System.out.println from java but for w/e reason i forgot i could use it