This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-17
Channels
- # beginners (51)
- # boot (31)
- # cider (14)
- # clara (13)
- # cljs-dev (15)
- # cljsjs (2)
- # cljsrn (53)
- # clojure (18)
- # clojure-dusseldorf (1)
- # clojure-russia (4)
- # clojure-uk (9)
- # clojurescript (53)
- # cursive (3)
- # datomic (5)
- # docs (1)
- # figwheel (2)
- # fulcro (42)
- # hoplon (3)
- # lein-figwheel (3)
- # leiningen (53)
- # off-topic (1)
- # om (4)
- # re-frame (11)
- # shadow-cljs (8)
that is what cljc is supposed to be for but no, you cannot, that doesn't work
you might notice that in cljs it's usually either foo.bar vs. foo.bar.macros or cljs.foo vs. cojure.foo
In an xml doc that starts like <?xml version=\"1.0\" encoding=\"UTF-8\">
, how is the encoding of the document made available to the calling code?
i'm trying to setup a hot reloader for my http kit service so for every change in one of my file it would re-run "lein run"
lein auto run just gets stuck on the server listening to requests - it probably waits for the process to finish its work (and it never does since its listening)
buzzdan the common approaches here are 1) pass the var for the handler to the server process and not the handler itself, that way when you redefine your handler, it gets used on the next request without needing to restart the server 2) define a start up and tear down such that every stateful condition in your code is reset when tearing down (so hold onto the return value given to you when the server starts, and later call its stop method after reloading code in order to start it up again)
when a globally defined function is called inside another function, your code will automatically see and use changes to the definition, but when the function is an argument to a long running process, the process itself won't see changes to the thing you passed as your argument - the var was dereferenced once when you called it. By passing #'handler
instead of handler
you are passing a var instead of resolving one, and conveniently if you try to call the var itself as if it were a function, it dereferences and calls the current value when called
for start up and tear-down, there are libraries like stuartsierra/component and weavejester/integrant made for this
@buzzdan I'll reiterate what @noisesmith said. We do live development on our web apps from the REPL, by using vars and Component.
QUESTION: What happens when you type hint something to the wrong type? Does Clojure try/catch the cast and defaults back to reflection?
@noisesmith that’s great advice. Do you have code samples demonstrating this somewhere?