This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-28
Channels
- # announcements (2)
- # babashka (15)
- # beginners (13)
- # chlorine-clover (17)
- # cider (14)
- # clj-kondo (1)
- # cljfx (3)
- # clojure (21)
- # clojure-australia (2)
- # clojure-europe (3)
- # clojure-nl (4)
- # clojurescript (25)
- # core-async (7)
- # cursive (8)
- # datomic (4)
- # defnpodcast (17)
- # events (1)
- # honeysql (5)
- # jobs-discuss (18)
- # pathom (8)
- # polylith (6)
- # reagent (2)
- # reveal (1)
- # shadow-cljs (2)
- # spacemacs (12)
- # tools-deps (13)
- # xtdb (2)
Just curious:
(for [elem [1 2 3]
:let [elem+1 (inc elem)]]
elem+1)
=> (2 3 4)
but
(for [:let [elems [2 3 4]]
elem elems]
elem)
Syntax error macroexpanding for at (core.clj:12:1).
Can't pop empty vector
is there a reason behind this behaviour? I think :let here makes senseI think there is a JIRA issue for it somewhere, but not very high priority, maybe even rejected. Just use a surrounding let
in this case.
Can anyone recommend a lib for managing datomic schema migrations with the client api library?
I think it's just fine.
Personally, I'd split the condition and the assoc
into two lines.
ClojureScript 1.10.773
cljs.user=> (def x :x)
#'cljs.user/x
cljs.user=> (identical? x :x)
false
I guess what I'm asking if it's ok to use cond->
to "simulate" something like
if (cond) return f(a) else a
@U2FRKM4TW Since this is the #clojure identical?
is appropriate, in CLJS you use keyword-identical?
, good to be aware
IMO that's exactly what it was created for. It supports a bit more, but that's OK use only a part of this potential.
You should probably be using the clojure.spec.alpha/invalid?
function though, the keyword may be an implementation detail
@U04V15CAJ makes sense, I'll change it
I'd use the shorter ::spec/invalid
form of the keyword (and split up the lines as @U2FRKM4TW suggested). Otherwise LGTM 👍