[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.
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., (continued)
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Stefan Monnier, 2016/01/19
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/19
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Eli Zaretskii, 2016/01/19
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/19
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Eli Zaretskii, 2016/01/19
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., John Wiegley, 2016/01/19
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/20
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Stefan Monnier, 2016/01/20
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/20
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Stefan Monnier, 2016/01/20
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'.,
Michael Heerdegen <=
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Eli Zaretskii, 2016/01/21
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Eli Zaretskii, 2016/01/21
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/21
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., John Wiegley, 2016/01/21
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Eli Zaretskii, 2016/01/22
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., John Wiegley, 2016/01/22
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/22
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., John Wiegley, 2016/01/22
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/22
- Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'., Michael Heerdegen, 2016/01/22