[Top][All Lists]

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


reply via email to

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