This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-13
Channels
- # beginners (42)
- # boot (33)
- # cider (4)
- # clara (1)
- # cljs-dev (2)
- # clojars (3)
- # clojure (207)
- # clojure-boston (1)
- # clojure-france (3)
- # clojure-india (7)
- # clojure-miami (1)
- # clojure-nl (8)
- # clojure-poland (13)
- # clojure-russia (102)
- # clojure-spec (22)
- # clojure-uk (37)
- # clojureremote (15)
- # clojurescript (229)
- # cursive (9)
- # datomic (1)
- # emacs (7)
- # figwheel (2)
- # funcool (1)
- # garden (1)
- # hoplon (7)
- # jobs (12)
- # jobs-discuss (27)
- # juxt (2)
- # leiningen (6)
- # luminus (9)
- # lumo (18)
- # off-topic (3)
- # onyx (9)
- # re-frame (54)
- # reagent (5)
- # remote-jobs (3)
- # ring (3)
- # rum (3)
- # specter (28)
- # yada (30)
Bore da
morning
good morning â
one of my favs today (by name at least) but also randomly picked:
clojure.core/lazy-cat
([& colls])
Macro
Expands to code which yields a lazy sequence of the concatenation
of the supplied colls. Each coll expr is not evaluated until it is
needed.
(lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))
Good morning people
it's not explicitely lazy but it preserves the laziness aspect of the underlying collections
then lazy-seq
was added and lazy-cat
was rewritten in terms of lazy-seq
and kept in core to preserve backwards compatibility
the reason why you would use lazy-cat
instead of bare concat
is on e.g. recursive definitions
(def foo (lazy-cat x (map f foo))
works, (def foo (concat x (map f foo)))
doesn't because foo
is still unbound
so while both lazy-cat
and concat
return lazy collections, lazy-cat
has lazy evaluation semantics (by virtue of being a macro) while concat
has strict evaluation semantics
thus lazy-cat
lets you write my favourite line of code: (def fibs (lazy-cat [0 1] (map + fibs (rest fibs))))
mixed feelings when : you find a bug in your system of record, but can resolve it, at least temporarily, without writing any code
@mccraigmccraig not writing code is (almost) always a good thing.
the not writing code bit was the good bit! that i managed to get a cassandra materialized view into a state where it randomly returned wrong answers was somewhat disturbing
does anyone here have (or has had) an âenvironments managerâ at their work? Any idea what they do or what theyâre for?
@glenjamin no idea what such a person would do... but sounds rather new-age.
itâs on an old lift-and-shift programme of work for a bunch of waterfally IT systems
build environments ? deployment environments ? is it an ops role ?