This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-17
Channels
- # 100-days-of-code (4)
- # announcements (4)
- # aws (2)
- # beginners (88)
- # cider (1)
- # cljsrn (9)
- # clojure (126)
- # clojure-conj (4)
- # clojure-dev (8)
- # clojure-greece (1)
- # clojure-italy (37)
- # clojure-nl (3)
- # clojure-spec (13)
- # clojure-uk (91)
- # clojurescript (392)
- # clojurewerkz (1)
- # clojutre (10)
- # core-async (6)
- # cursive (5)
- # data-science (1)
- # datomic (41)
- # emacs (21)
- # events (1)
- # figwheel-main (52)
- # fulcro (2)
- # hyperfiddle (4)
- # jobs (3)
- # jobs-discuss (9)
- # luminus (3)
- # lumo (9)
- # mount (1)
- # nyc (1)
- # off-topic (73)
- # other-languages (6)
- # pedestal (8)
- # portkey (2)
- # re-frame (9)
- # reagent (8)
- # rum (17)
- # shadow-cljs (38)
- # sql (19)
- # tools-deps (18)
- # yada (4)
A few days ago in the #clojure channel someone said: "i've just realized (= '(1 2 3) [1 2 3]) => true" if for some reason i don't want this behavior, what can I do?"
Alex Miller responded "The reasons for this are subtle and important and in many ways essential for Clojure to be what it is"
I've written an article once where I explained only briefly the reasons for this behavior as follows: "it was considered useful and convenient". That might be leaving out much better arguments, and I was curious if anyone had any in mind, and/or articles that go into that decision in more depth.
It is useful and convenient in many ways. I can also think of cases where it makes programs more efficient, because you do not need to convert between different sequence types before comparing them using an imagined strict-= that only returned true if the sequential things being compared had the same type.
The main thing is that we frequently switch sequential types, most obviously from concrete colls like lists and vectors to seqs, but other cases too
Blurring those lines is really important to make working with seq functions low friction
Whenever possible I try to write code that is agnostic to the type of the sequential coll
Auto seq on seq function inputs is in same ballpark