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.
I never managed to get GPG working on my Windows laptop and I've had GPG/GPGTools get corrupted twice on my Mac, so I finally gave up on it. The time it forgot my private key and wouldn't accept the correct passphrase so my GPG "identity" was basically broken -- and that's the second or third time that's happened to me and I've had to start over and create a new key and publish that... and it just doesn't feel like it's worth the effort for such flaky software.
seancorfield: gpg is flaky? that would be pretty shocking. i've used it for years on osx with no prob. how do you know gpg was the problem?
I'm sure the underlying encryption stuff is solid -- but the tooling that interacts with Mail and interacts with Leiningen doesn't seem solid.
I only started using it because Phil was such a hard-ass about encouraging people to sign stuff 🙂
He tried to encourage key-signing parties at Clojure conferences but I think he was fighting an uphill battle...
yeah, but you're painting with a pretty broad brush, imho. let's not blame gpg for the failings of tools that use it.
Not being able to use it on Windows with Leiningen meant I could only ever update Clojars from my Mac and so I started to switch projects to Boot to get around that 🙂
I don't know what specifically corrupted/forgot my keys on OS X but the fact that it's happened more than once makes me tired of dealing with the toolchain -- and I don't need it for anything except satisfying Leiningen (and I could just turn that off per repo if I could be bothered to figure it out... but I'm using Leiningen less and less anyway so it's just not worth the hassle).
A lot of GNU stuff is very user-hostile and poorly documented (and I say that as someone who has contributed to GNU software, by the way!).
not it is not, the tutorial from the leinigen docs on gpg is better than what I found on the actual website... I understand why Phil would encourage to sign though.
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.