This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-27
Channels
- # beginners (113)
- # calva (39)
- # cider (18)
- # cljs-dev (19)
- # cljsrn (1)
- # clojure (80)
- # clojure-dusseldorf (1)
- # clojure-finland (1)
- # clojure-gamedev (1)
- # clojure-germany (2)
- # clojure-italy (38)
- # clojure-nl (16)
- # clojure-spec (90)
- # clojure-uk (81)
- # clojurescript (28)
- # clojutre (9)
- # cursive (47)
- # data-science (4)
- # datomic (21)
- # emacs (1)
- # events (2)
- # fulcro (11)
- # graphql (2)
- # hoplon (8)
- # hyperfiddle (23)
- # jobs (2)
- # kaocha (4)
- # lein-figwheel (1)
- # luminus (1)
- # mount (1)
- # off-topic (41)
- # pathom (5)
- # pedestal (27)
- # reitit (6)
- # remote-jobs (7)
- # ring-swagger (6)
- # shadow-cljs (42)
- # spacemacs (1)
- # sql (9)
- # tools-deps (6)
- # uncomplicate (2)
- # vim (5)
@dnolen I love so much Clojurescript (and my customer also) that we are not angry at all about this breaking change. We understand retroactively that we made a bas usage of key
and val
on vectors. Indeed, we shouldn’t. But the fact is that we did!
I also see in https://github.com/clojure/clojurescript/blob/master/changes.md that Cljs 1.10.238 contains this change
> Map entries are no longer two element vectors, now MapEntry instances
But from here it’s not really clear that my key
and val
usages are going to be broken
A little warning about that would have been very helpful
@viebel it is pretty much impossible to predict all possible scenarios in which a change may break code. It was simply not expected to use key
or val
on sequences so warning about something we don't know people are using in the first place is kinda hard.
I see @thheller
By the way, it also breaks om as in om MapCursor implements of ISeq by returning a seq of 2 elements vectors
https://github.com/omcljs/om/blob/master/src/main/om/core.cljs#L625-L628
Therefore (vals map-cursor)
used to work previous cljs 1.10 and not on anymore cljs 1.10
should fix that, but also demonstrates why this behavior was really undesirable in the first place
What behaviour was undesirable in the first place? (and why is it undesirable?)
@dnolen What behaviour was undesirable in the first place? and why is it undesirable?
Do you want a patch for om ?
Wrapping the current code with (into {}…)
Something like that:
ISeqable
(-seq [this]
(when (pos? (count value))
(seq (into {} (map (fn [[k v]] [k (-derive this v state (conj path k))]) value)))))
At audyx, we still use om
!
Just to be clear, this doesn’t have any implications on destructuring a MapEntry, right?
(map (fn [[k v]] [k (f v)]) my-map)
etc etc
In other words, MapEntry still behaves as a vec, but vecs stop behaving as MapEntries
Destructuring uses the IIndexed
abstraction I believe:
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L6680
Yep. I guess I’m more asking if it’s still “philosophically cool” 😛