This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-29
Channels
- # admin-announcements (1)
- # aws (10)
- # beginners (76)
- # boot (53)
- # braid-chat (1)
- # cider (80)
- # cljs-edn (3)
- # clojure (65)
- # clojure-belgium (2)
- # clojure-gamedev (2)
- # clojure-nl (3)
- # clojure-poland (1)
- # clojure-russia (39)
- # clojure-uk (14)
- # clojurescript (91)
- # cursive (62)
- # datascript (1)
- # datomic (9)
- # dirac (34)
- # emacs (25)
- # error-message-catalog (8)
- # events (1)
- # hoplon (88)
- # instaparse (1)
- # jobs (2)
- # jobs-discuss (6)
- # lein-figwheel (7)
- # luminus (43)
- # mount (5)
- # off-topic (7)
- # om (28)
- # onyx (61)
- # planck (4)
- # re-frame (27)
- # reagent (3)
- # remote-jobs (2)
- # spacemacs (3)
- # untangled (136)
@chrisdevo: i'd love to have that feature, but i couldn't figure out how to do it cleanly
like it would be cool to have something like if you have a flag --foo
then boot could autogenerate the --no-foo
flags too
but because of the way the cli argument parser we used works it doesn't seem straightforward to do
@chrisdevo if the flag is not supplied, the value will be nil
which is already falsey, so you can just do things like (when foo (do-something))
@micha, in order to pass params to pod we need basically to transform them to strings and back right? I was thinking, maybe we just need a protocol on types with "marshal" and "unmarshal" to do it transparently instead of
... in a pod ...
(repl/launch-nrepl {:init-ns (symbol ~(str init-ns))
:port (Long/parseLong ~(str port))
...
a case
with clojure Symbol
Keyword` would also work but this info needs to be present in the pod I guess, aka boot.pod/eval-in-caller
, kind of backtick post-processing
akin to custom resolvers I guess: (defquote shout-quote (comp symbol clojure.string/upper-case))
going another step further:
(defn through-pod
[datum]
(condp = (class datum)
clojure.lang.Symbol (symbol (str datum))))
(bt/defquote pod-quote (comp symbol through-pod))
Now I just need to know/discover where to put it in boot πso this works in the repl:
(require '[boot.from.backtick :as bt])
(defn through-pod
[datum]
(condp = (class datum)
clojure.lang.Symbol (symbol datum)
clojure.lang.Keyword (keyword datum)))
(bt/defquote pod-quote (comp symbol through-pod))
...
(pod/with-pod @pod
(repl/launch-nrepl {:init-ns (~pod-quote-fn ~(str init-ns))
:port ~port
:server true
:middleware (:middleware pod/env)}))
the only thing you can't do is refer to names that don't exist in the pod or to objects that only exist in memory in one of the pods
mmm...I thought no π It throws an error if I evaluate:
(pod/with-pod @pod
(repl/launch-nrepl {:init-ns ~init-ns
:port ~port
:server true
:middleware (:middleware pod/env)}))
(pod/with-pod @pod
(require '[boot.pod :as pod])
(require '[boot.util :as util])
(require '[boot.repl :as repl])
(require '[clojure.tools.namespace.repl :as tnsr])
(util/info "Launching %s...\n" ~pod-env)
(util/info "Launching backend nRepl...\n")
(apply tnsr/set-refresh-dirs (-> pod/env :directories))
(repl/launch-nrepl {:init-ns '~init-ns
:port ~port
:server true
:middleware (:middleware pod/env)})
(require 'dev)
(require 'reloaded.repl)
(reloaded.repl/go))
but it java.lang.ClassNotFoundException: org.clojure, compiling:(NO_SOURCE_PATH:0:0)
still a problem but in this case I am missing something on the classpath maybe:
Launching backend nRepl...
nREPL server started on port 5600 on host 127.0.0.1 -
:unknown "java.net.ServerSocket"
:unknown "clojure.lang.Atom"
:unknown "java.net.ServerSocket"
clojure.lang.ExceptionInfo: clojure.tools.nrepl.server.Server
data: {:file "/tmp/boot.user7459477259827150576.clj", :line 77}
java.lang.ClassNotFoundException: clojure.tools.nrepl.server.Server
...
clojure.core/eval/invokeStatic core.clj: 3105
Only if you have one eye on the monitor
Launching {:dependencies [[org.clojure/clojure "1.8.0"] [com.taoensso/timbre "4.3.1"] [aleph "0.4.1-beta3"] [bidi "1.24.0"] [yada "1.1.11"] [aero "1.0.0-beta2"] [com.stuartsierra/component "0.3.1"] [org.clojure/tools.namespace "0.2.10"] [reloaded.repl "0.2.1"] [prismatic/schema "1.0.4"] [org.clojure/core.async "0.2.374"] [org.clojure/tools.reader "0.10.0"] [org.clojure/tools.logging "0.3.1"] [org.slf4j/jcl-over-slf4j "1.7.13"] [org.slf4j/jul-to-slf4j "1.7.13"] [org.slf4j/log4j-over-slf4j "1.7.13"] [ch.qos.logback/logback-classic "1.1.3" :exclusions [org.slf4j/slf4j-api]] [org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]], :middleware [boot.from.io.aviso.nrepl/pretty-middleware], :source-paths #{"env/dev" "dev" "src/backend"}, :resource-paths #{"resources"}, :directories #{"env/dev" "dev" "src/backend" "resources"}}