[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Easy to add with push but not to the end of a list
From: |
Michael Heerdegen |
Subject: |
Re: Easy to add with push but not to the end of a list |
Date: |
Sun, 01 Jan 2023 13:16:31 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Emanuel Berg <incal@dataswamp.org> writes:
> (defmacro pushlast (newelt place)
> (declare (debug (form gv-place)))
> (if (symbolp place)
> (list 'setq place
> (list 'append place (list 'cons newelt nil)) )
> (macroexp-let2 macroexp-copyable-p x newelt
> (gv-letplace (getter setter) place
> (funcall setter `(append ,getter (cons ,x nil))) ))))
LGTM. But you can skip the special treatment of the simple
(symbolp place) case since your macro is not used while bootstrapping.
Michael.
- Re: Easy to add with push but not to the end of a list,
Michael Heerdegen <=