emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] extend map-into


From: Andrea Corallo
Subject: Re: [PATCH] extend map-into
Date: Sun, 06 Oct 2019 20:59:50 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix)

Stefan Monnier <address@hidden> writes:

> [ 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).

Cool, is the attached patch doing what you suggest?

> 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))
>

ops :D

>         Stefan
>

Bests

  Andrea

-- 
address@hidden

Attachment: 0001-Extend-map-into-for-better-control-on-hash-table-cre.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]