[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt
From: |
Nicolas Petton |
Subject: |
bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt |
Date: |
Tue, 21 Mar 2017 12:35:35 +0100 |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> (macroexp-let2 nil key
>> `(progn
>> (map--dispatch ,map
>> :list (setf (alist-get ,key ,map nil t) nil)
>> :hash-table (remhash ,key ,map)
>> :array (and (>= ,key 0)
>> (<= ,key (seq-length ,map))
>> (aset ,map ,key nil)))
>> ,map)))
>
> Note that this will make it pretty much impossible to use
> cl-generic dispatch.
Indeed, but I already have that issue. To use `cl-generic', map.el has
to be basically rewritten from scratch.
> A better option might be to provide a map-remove which works
> functionally (i.e. doesn't modify its argument by side-effects)
I'd love to have that, but what about performance issues with
hash-tables?
hash-tables aren't persistent collections, and having `map-remove',
`map-add', etc. work functionally, the hash-table would have
to be copied for each operation.
Cheers,
Nico
signature.asc
Description: PGP signature
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, (continued)
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Lars Ingebrigtsen, 2017/03/22
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Noam Postavsky, 2017/03/22
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Lars Ingebrigtsen, 2017/03/22
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Michael Heerdegen, 2017/03/22
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Stefan Monnier, 2017/03/22
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Lars Ingebrigtsen, 2017/03/22
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Stefan Monnier, 2017/03/22
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Stefan Monnier, 2017/03/22
- bug#25929: 25.2; plists and map-*, Lars Ingebrigtsen, 2017/03/29
- bug#25929: 25.2; plists and map-*, Nicolas Petton, 2017/03/29
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt,
Nicolas Petton <=
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Stefan Monnier, 2017/03/21
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Nicolas Petton, 2017/03/21
- bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt, Stefan Monnier, 2017/03/21