Fork me on GitHub
#unrepl
<
2018-03-18
>
dominicm18:03:30

@cgrand couldn't see anything in the wiki particularly 🙂 Got a write up anywhere on it?

cgrand20:03:48

Yes but the discussion is held in hostage by Slack.

cgrand20:03:15

@dominicm the idea would have to have a single repl but use reader conditional to select if you sending code to clojure or to clojurescript.

dominicm20:03:20

That seems odd to me, so you'd send #?(:cljs (js/alert "hi"))?

dominicm20:03:34

Seems like a repurposing of the intention of it I guess 🙂

cgrand20:03:35

My initial idea would mean that unconditional code would get evaluated twice. Which is not very practical. @bhauman thinks that abusing a top reader conditional would be ok. So uncond -> cljs, cond -> dispatch

dominicm20:03:06

I wonder if there's ever a case for having multiple cljs repls? e.g. if you have multiple cljs clients in one jvm.

dominicm20:03:23

figwheel supports build-ids for this.

dominicm20:03:16

I'm wondering if it should actually be #?(:figwheel/build-id (js/alert "hi")) and the dispatch happens on (or (namespace k) (name k))

cgrand20:03:47

I think you are trying too hard: you tie one cljs|c repl to one cljs env.

dominicm20:03:53

Oh, but that pushes management onto client. So it's better to be agnostic in some way. Yeah, this gets complicated fast.

cgrand20:03:12

What if you have several Clojures in one jvm?

dominicm20:03:13

don't be silly. you can't do that. clojure.lang.RT wouldn't let you! I have literally 0 context for how that would work right now tbh - because I never see it.

ghadi20:03:27

Sorry for the aside here - what do people do in order not to statically assign socket repl binding ports?

cgrand20:03:29

Classloader isolation. I believe Boot does that all day long with pods.

ghadi20:03:02

Interesting

dominicm20:03:28

@cgrand That works via (boot.pod/with-eval-in X …) So I guess you're suggesting something similar could work for cljs, with a default or something?