This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-25
Channels
- # announcements (1)
- # babashka (3)
- # beginners (48)
- # calva (1)
- # clj-kondo (1)
- # cljs-dev (6)
- # clojure (29)
- # clojure-europe (15)
- # clojure-spec (1)
- # clojure-uk (8)
- # clojurescript (17)
- # conjure (23)
- # css (7)
- # cursive (16)
- # datascript (1)
- # emacs (4)
- # fulcro (32)
- # hoplon (3)
- # keechma (16)
- # leiningen (1)
- # luminus (1)
- # meander (11)
- # off-topic (18)
- # pathom (15)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # reveal (5)
- # spacemacs (5)
- # xtdb (18)
[meander/epsilon "0.0.479"]
This release fixes the regression pointed out recently.đź‘Ť 3
So, I got another question -- is there any way to force some type of grouping?
(m/search [{:a :whatever :b [{:n 1} {:n 2} {:n 1}]}
{:a :goes :b [{:n 1} {:n 2} {:n 4}]}
{:a :here :b [{:n 2} {:n 2} {:n 3}]}]
(m/scan {:a ?a :b (m/scan {:n !n})})
{:a ?a :n !n})
;; => currently returns
({:a :whatever, :n [1]}
{:a :whatever, :n [2]}
{:a :whatever, :n [1]}
{:a :goes, :n [1]}
{:a :goes, :n [2]}
{:a :goes, :n [4]}
{:a :here, :n [2]}
{:a :here, :n [2]}
{:a :here, :n [3]})
;; => what I'm going for
[{:a :whatever :b [1 2 1]}
{:a :goes :b [1 2 4]}
{:a :here :b [2 2 3]}]
Not yet. At the moment the recommendation is to use group-by
— cool, if gather
helps you accomplish what you’re after, by all means, use that. If you really need group-by
use that.
The plan is to have a primitive for this called a “fold” which is essentially a variable that uses a reduction when it binds.