emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Docu


From: Michael Heerdegen
Subject: Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'.
Date: Thu, 21 Jan 2016 18:44:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> >> > @Stefan: can you enlighten us why you didn't initially do this?
> >> 'Cause I don't know how.
> > I don't understand...what don't you know?
>
> How to provide a function that does the core work of (setf (alist-get
> ..) ...), such that it can be used in the expanded code and ideally
> even independently.

I see.

I think if we add an `alist-put', it should ideally be a macro (in
analogy to `push' that adds to a plain list), and the signature should
be analogous to `alist-get' OTOH.  So we would end up with something
like

--8<---------------cut here---------------start------------->8---
(defmacro alist-put (key value place &optional default remove)
  (gv-letplace (_ setter) `(alist-get ,key ,place ,default ,remove)
    (funcall setter value)))
--8<---------------cut here---------------end--------------->8---

Would it make sense to add something like this?


Michael.




reply via email to

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