[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] extend map-into
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] extend map-into |
Date: |
Sun, 06 Oct 2019 10:02:54 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
[ I added Nicolas explicitly in the list, in case he's too busy to read
all messages. ]
> would a solution like the one in attached patch do the job?
Yes and no: it does the job, but only for `map-into`. So that doesn't
immediately cover the needs of `map-merge` and other callers of
`map-into` (e.g. the `map-values-apply` I suggested which would return
a new map).
I guess we could use a `type` that's not a symbol but a list (whose
head is a symbol and the rest are the args), but it could be a bit
inconvenient (and would impact efficiency as well because it makes the
cl-generic dispatch more complex).
On a related note, maybe it would be good to have map.el primitives that
let you create a new map of the same type as another (preserving :test).
> + (let* ((h-args (if keyword-args
> + keyword-args
> + (list :size (map-length map) :test 'equal)))
Aka (or keyword-args (list :size (map-length map) :test 'equal))
Stefan
- new function proposal alist-to-hash, Andrea Corallo, 2019/10/03
- Re: new function proposal alist-to-hash, Andrea Corallo, 2019/10/04
- [PATCH] extend map-into (was: new function proposal alist-to-hash), Andrea Corallo, 2019/10/05
- Re: [PATCH] extend map-into,
Stefan Monnier <=
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/06
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/08
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/08
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/08
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/09
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/09
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/09
- Re: [PATCH] extend map-into, Nicolas Petton, 2019/10/10
- Re: [PATCH] extend map-into, Nicolas Petton, 2019/10/10
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/10