This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (4)
- # beginners (47)
- # boot (22)
- # cider (7)
- # clara (1)
- # cljs-dev (8)
- # cljsrn (21)
- # clojure (180)
- # clojure-argentina (13)
- # clojure-gamedev (1)
- # clojure-italy (5)
- # clojure-poland (4)
- # clojure-russia (17)
- # clojure-spec (19)
- # clojure-uk (33)
- # clojurescript (107)
- # cursive (61)
- # data-science (1)
- # datomic (7)
- # emacs (69)
- # euroclojure (1)
- # graphql (1)
- # hoplon (11)
- # immutant (43)
- # jobs (1)
- # leiningen (3)
- # off-topic (5)
- # om (10)
- # onyx (2)
- # parinfer (52)
- # pedestal (11)
- # re-frame (31)
- # reagent (23)
- # ring-swagger (3)
- # schema (2)
- # specter (7)
- # unrepl (9)
(if (seq xx) ... would be more idiomatic (and faster) than
(if (> (count xx) 0) ...
(defn map-but-last [f1 f2 coll] (map #(%1 %2) (conj (into  (repeat (dec (count coll)) f1)) f2) coll))
That would be lazy
(defn map-but-last [f1 f2 coll] (map (fn [[x y]] (if y (f1 x) (f2 x))) (partition-all 2 1 coll)))
(map-but-last inc dec (range 5)) => (1 2 3 4 3)
(note that it never hits the "last" element so it only ever calls
(take 20 (map-but-last inc dec (range))) => (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
(defn map-but-last [f1 f2 coll] (let [[h & t] coll] (if (seq t) (lazy-seq (cons (f1 h) (map-but-last f1 f2 t))) (list (f2 h)))))
@U61HA86AG No, because the call is not in the tail position, so
recur is not allowed there.
@jstokes Good point, but changing the function to
(fn [[x _ :as pair]] (if (= 2 (count pair)) (f1 x) (f2 x))) would solve that 🙂
has anyone here used the automata library? (https://github.com/ztellman/automata) I’m working on a project that could use a state machine, but I have some noob-ish questions about an implementation. to save time — how would I go about using functions to determine state changes?
Hey guys i don’t really know where else to ask this question even though it is not exactly clojure related. Anyways... I am trying to push a jar onto clojar but here is the problem. I am following the tutorial about gpg https://github.com/technomancy/leiningen/blob/stable/doc/GPG.md At some point I need to
gpg --list-keys to get my KEY_ID so that I can publish it then use it to sign my jar and push to clojars. Unfortunately the output of
gpg --list-keys isn’t the same on my machine as it it in the tutorial, the KEY_ID isn’t displayed and I can’t find how to make gpg display it. Going nuts... plz help 🙏
@jeremys Two options you might want to consider: telling Leiningen not to sign the JAR and avoiding the whole GPG thing; switching to Boot which doesn't sign JARs by default and therefore side-steps GPG as well.
Thanks @seancorfield I didn’t know boot did that! though after close to an our on the internet I foudn the answer to my problem in a page not really related. You can actually use the command
gpg --keyid-format (short/long) --list-keys to get the output as in the tutorial.
I guess gpg on windows might be hard and to frank and very opinionated the style of documentation of gnu projects of especially this one isn’t really helpfull.
Little digression, if you take a look at the discussion on the clojure channel apparently clojure might release it’s own dependency tools that isn’t dependent on maven. We might be able to pull our deps from github directly some day...
Given that Clojars no longer support the whole "promotion" thing (which required signed JARs) and a lot of people don't bother signing JARs, I'm not sure how important it is. For a while I used to "sign" all my emails, as well as my JARs, but several friends complained their email client couldn't read signed emails so I gave up on that first 😐
Yeah, pretty sure both Leiningen and Boot have a way to deal with dependencies as checked-out GitHub repos.
There are a couple of tech stacks out there that let you declare a dependency as a GitHub coordinate
username/[email protected] so there's a precedent.
In any case thanks for the help. I might try to sign this jar since I don’t really want to admit defeat yet. But I might consider giving it up later 🙂
gpg has always been unforgiving and irritating except during short windows of time when I'm really concentrating on getting something done with it. Afterward all is quickly forgotten and usage needs to be relearned more or less from scratch the next time.