This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-21
Channels
- # admin-announcements (2)
- # aws-lambda (2)
- # beginners (26)
- # boot (179)
- # cider (36)
- # cljs-dev (118)
- # cljsrn (23)
- # clojure (150)
- # clojure-android (1)
- # clojure-austin (7)
- # clojure-austria (3)
- # clojure-canada (1)
- # clojure-dev (7)
- # clojure-dusseldorf (4)
- # clojure-germany (3)
- # clojure-greece (34)
- # clojure-nl (4)
- # clojure-quebec (9)
- # clojure-russia (30)
- # clojure-spec (38)
- # clojure-uk (3)
- # clojurescript (46)
- # clr (1)
- # core-async (2)
- # css (2)
- # cursive (17)
- # datomic (12)
- # devcards (8)
- # dirac (1)
- # docker (2)
- # hoplon (216)
- # jobs (2)
- # kekkonen (1)
- # lein-figwheel (18)
- # leiningen (2)
- # luminus (1)
- # mount (4)
- # off-topic (2)
- # om (15)
- # onyx (1)
- # parinfer (1)
- # pedestal (2)
- # planck (26)
- # reagent (98)
- # spacemacs (6)
- # specter (19)
- # spirituality-ethics (54)
- # untangled (22)
- # vim (24)
- # yada (4)
hello how do you update a clojure jar that runs a ring server? do I have to shut it down then restart it (or use something like /etc/inittab)?
(doc contains?)
-------------------------
clojure.core/contains?
([coll key])
Returns true if key is present in the given collection, otherwise
returns false. Note that for numerically indexed collections like
vectors and Java arrays, this tests if the numeric key is within the
range of indexes. 'contains?' operates constant or logarithmic time;
it will not perform a linear search for a value. See also 'some’.`
In your example, a vector contains letters and test is made on indexes
(map #(contains? [\a \e \i \o \u] %) (range 6))
shows that.
Yes, it’s confusing.
You can use instead the set
of letters
(contains #{\a \e \i \o \u} \e)
returns true
Frequently used: set
is also a function returning given argument if it contains it:
(#{\a \e \i \o \u} \e)
returns \e itself.@st the way to check if a collection (vector, seq) contains an element is to use some
+ a set: (some #{(first "aro")} [\a \e \i \o \u])
this is explained in full detail here https://lambdaisland.com/episodes/clojure-core-some
@adrien you don't usually "update" a jar, you build a new one and switch to it by stopping the old server and starting the new one
that jar is a symlink to whatever the latest version is. When I deploy I update that symlink, then do systemctl restart lambdaisland
to stop the old version and start the new one. The benefit of doing this with systemd is that it will automatically start at boot, and restart if the process dies
happy to help! what this doesn't get you is zero-downtime deploy. It's not too hard to add, the short downtime while starting the new server just hasn't annoyed me enough yet
🙂 same for me, it's a hobby project, but I'd like to have some users, and know how things work in production
also, like this, it's easy to automate it with a Jenkins job, say, to have continuous deployment
the article I found for Digital Ocean was using supervisor, which didn't feel very unix-y to me
hey guys, how can I make my repl sees my new global that I created in the code with (def myvar) ?
good! I was using (in-ns ‘my.namespace)
I will stop to do that and keep using user namespace requiring stuff
Where do I specify namespaces I want my repl to always use on startup? i.e. (use ‘clojure.repl) so I have access to (doc ) and (source )
@fingertoe: I believe with leiningen, you can use a user.clj
file to load up code
@fingertoe: in project.clj I've got a key :repl-options {:init-ns dev}
and then in dev.clj:
(ns dev
(:require
[clojure.repl :refer [apropos dir doc find-doc pst source]] ...