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 you can change the name and treat it as complement
I don't think there is a way to set defaults for params in boot
@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)}))
@richiardiandrea: i don't understand what you mean about converting to strings?
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)}))
where init-ns
is dev
as symbol
ok, so maybe I did not understand how it worked fully ๐
yes I am doing that, just cut a bit..
(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)
so do I need to quote all the external symbols? Like port
as well?
ah, understand, I need to capture the symbol outside
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
but thanks that was useful
yeah...
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"}}
it is a sample app that I am porting to boot
where is this :unknown
stuff coming from lol
Newbie question: should I be able to execute tasks in a pod?