This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-24
Channels
- # announcements (4)
- # beginners (37)
- # boot (13)
- # boot-dev (3)
- # calva (122)
- # cider (16)
- # clara (13)
- # cljs-dev (3)
- # cljsrn (8)
- # clojure (311)
- # clojure-denver (1)
- # clojure-dev (14)
- # clojure-europe (7)
- # clojure-italy (36)
- # clojure-nl (3)
- # clojure-spec (11)
- # clojure-uk (77)
- # clojurescript (91)
- # core-async (10)
- # cursive (9)
- # data-science (5)
- # datomic (46)
- # devcards (2)
- # emacs (6)
- # figwheel-main (15)
- # fulcro (51)
- # jobs (3)
- # kaocha (10)
- # nrepl (6)
- # off-topic (53)
- # om (1)
- # onyx (2)
- # pathom (5)
- # reagent (50)
- # reitit (26)
- # shadow-cljs (153)
- # spacemacs (17)
- # specter (5)
- # speculative (1)
- # test-check (19)
- # tools-deps (15)
- # yada (3)
Would it make sense to extend the for
macro with an :into
option, like some spec operators have? This way it could build a collection without first having to build a lazy seq
I can't think of any objections on "that wouldn't work" or "isn't useful" grounds probably only "might look weird" or "not a good enough reason to change anything"
I went through a heap of 4clojure code today and I saw lot of (set (for ...))
calls, that gave me the idea
the thing with for is, seqs are a universal iteration protocol, so for can take a bunch of input collections, and iterate over them lazily by consuming seqs
a new version of for, not tied to seqs, would need some new iteration protocol for consuming collections
so you would have a for macro that generates a transducer with a source collection packaged together in an eduction
https://ce2144dc-f7c9-4f54-8fb6-7321a4c318db.s3.amazonaws.com/reducers.html has a simplified rfor macro based on clojure.core.reducers