This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # beginners (19)
- # boot (11)
- # cider (59)
- # cljs-dev (292)
- # cljsrn (2)
- # clojure (121)
- # clojure-brasil (19)
- # clojure-canada (2)
- # clojure-france (2)
- # clojure-italy (57)
- # clojure-spec (54)
- # clojure-uk (20)
- # clojurescript (83)
- # core-async (20)
- # cursive (5)
- # datascript (2)
- # datomic (10)
- # duct (25)
- # editors (4)
- # emacs (2)
- # fulcro (5)
- # funcool (1)
- # graphql (2)
- # immutant (8)
- # java (1)
- # jobs (4)
- # jvm (1)
- # keechma (5)
- # luminus (10)
- # off-topic (113)
- # om (36)
- # onyx (11)
- # parinfer (55)
- # pedestal (7)
- # protorepl (28)
- # re-frame (25)
- # reagent (6)
- # ring-swagger (1)
- # shadow-cljs (113)
- # spacemacs (1)
- # specter (23)
- # unrepl (8)
- # yada (8)
what is protorepl actually doing when you start executing a form from a file? is it parsing your
ns declaration to figure out what your namespace aliases are? or does it communicate with the build process (or the lein server repl or whatever the right terminology is)
i’m asking because i am using shadow-cljs and now protorepl is dumping a bunch of errors and i don’t know how to diagnose because i don’t understand what it is doing
@lee.justin.m If you execute a whole file, it just tells the REPL to
load that file. If you execute a form, it literally just sends it to the REPL as-is to evaluate.
how does it know to switch to the namespace of the form? is that something that the protorepl code does by parsing the
once, when i had a functioning protorepl, i was just able to send a bunch of specter forms to the repl and everything worked. so i think it must have understood my imports because the forms were not fully qualified
the other related thing i don’t understand is that this was only possible (I think) when I started figwheel inside the repl and then executed
Note too that if you send a file, it sends the file on disk, not the file in your Atom buffer. Save before sending files and you'll get what you see.
Sending a file to the REPL doesn't change the REPL's namespace; it just loads the definitions in their namespace. If you send the
ns form directly, it's just as if you typed that into the REPL, and will change the namespace, expose any included definitions, etc.
You can think of sending a file as being declarative: "I want these definitions around." Sending a form is more declarative: "Execute this and tell me what the result is."
One changes the environment the REPL is sitting in, the other works with the REPL itself.
partial-answer: yes it looks for a top-level form beginning with
/^\(ns / and parses that form
oh sorry @fellshard your answer was almost the exact same shape and size as mine i my mind skipped it 🙂
Naw, you're asking / answering a more specific question about how it determines which ns an executed form is in
before i switched to shadow-cljs and broke everything, I thought that I was capable of starting figwheel in the repl and then executing forms from my source code, even when the forms did things like reference shortened ns aliases. maybe i imagined that
looking at the protorepl source code it doesn’t seem possible that that could work but again, i do not understand the complexities of clj vs. cljs repl and what it means to connect to an nrepl, etc.
Hey, crossposting from #editors... (hadn't had a response today and it was suggested here might be a better place)
I've installed proto-repl for atom but whenever I try to run code in a self-hosted repl I get the error
TypeError: Cannot set property 'user' of undefined. I've set the path to the
lein binary, is there any other configuration that might need setting up or perhaps someone recognises this issue~?
@oliver089 Does the REPL seem to start OK? You get the error just when you type code in?
@seancorfield yes, it was in fact working when I first installed it, but when I reopened atom I hit that problem
I've never used the self-hosted REPL (since it's cljs) but I just went and tried it and I get the same error. So I guess the self-hosted REPL is just broken at the moment...
@oliver089 The self-hosted REPL doesn't care about Leiningen / Boot, since it just runs inside the IDE itself (as far as I know).
so what do people who write cljs actually use? i guess they just do it via the terminal? i’ve had very little luck getting cljs editor integrations to work, including cider