clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
flowthing 2021-03-08T09:24:30.243100Z

Why can't I call (or access in any way) cljs.repl/repl (https://github.com/clojure/clojurescript/blob/69b66374d857a176c5a9cd8cc0cbb7506876640d/src/main/clojure/cljs/repl.cljc#L1226)?

λ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "RELEASE"}}}' -M -m cljs.main --repl
ClojureScript 1.10.773
cljs.user=> (require '[cljs.repl :as repl])
nil
cljs.user=> (repl/repl)
WARNING: Use of undeclared Var cljs.repl/repl at line 1 <cljs repl>
Execution error (TypeError) at (<cljs repl>:1).
undefined is not an object (evaluating 'cljs.repl.repl.call')

cljs.user=> (repl/pst)
TypeError: undefined is not an object (evaluating 'cljs.repl.repl.call')
@
@
eval code@
eval@[native code]
@http://localhost:9000/clojure/browser/repl.js:119:300
clojure$browser$repl$evaluate_javascript@http://localhost:9000/clojure/browser/repl.js:122:4
@http://localhost:9000/clojure/browser/repl.js:385:57
@http://localhost:9000/clojure/browser/repl.js:387:4
@http://localhost:9000/goog/messaging/abstractchannel.js:141:21
@http://localhost:9000/goog/net/xpc/crosspagechannel.js:729:19
@http://localhost:9000/goog/net/xpc/nativemessagingtransport.js:321:23
@http://localhost:9000/goog/events/events.js:753:25
@http://localhost:9000/goog/events/events.js:879:34
@http://localhost:9000/goog/events/events.js:296:42
nil

flowthing 2021-03-08T09:26:35.244Z

Oh, I guess it must be one of those functions that's only available in Clojure.

flowthing 2021-03-08T09:29:10.245200Z

My use case is that I want to connect to a ClojureScript Socket REPL (https://gist.github.com/swannodette/f1a9bfbf7cc4d0c43e61) from my editor and start a new REPL inside the original REPL, but I guess that's not possible.

thheller 2021-03-08T09:41:07.245900Z

you can start a CLJ REPL and then start the CLJS REPL from there. CLJS from inside CLJS doesn't work.

flowthing 2021-03-08T09:47:03.246800Z

Right, thanks. I think I can make that work. Ideally, I'd really like to start something like a CLJC REPL, but let's see if I can make that work.

afleck 2021-03-08T16:13:18.248700Z

I am getting an Eval timed out! error when trying to pprint a (very) large map in a cljs repl (i’m using CIDER). any way to get around this? Like when I pprint a huge map in clojure it will truncate the output at some point.

blak3mill3r 2021-03-08T22:34:46.249900Z

@andrea_fleckenstein you might benefit from https://github.com/brandonbloom/fipp which is faster than pprint and supports cljs

blak3mill3r 2021-03-08T22:35:31.250500Z

there are also dynamic vars in clojure.core that control printing

blak3mill3r 2021-03-08T22:35:42.250800Z

clojure.core/*print-level* can limit the depth of printing large nested things

blak3mill3r 2021-03-08T22:36:10.251100Z

clojure.core/*print-length* can limit how many elements of a large collection will be printed