[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: |
Emanuel Berg |
Subject: |
Re: Easy to add with push but not to the end of a list |
Date: |
Sat, 31 Dec 2022 23:09:37 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Michael Heerdegen wrote:
>> How do you do a `pushlast' macro?
>
> I would start with `push' and change the definition so that
> the expansion uses an according `append' call.
Like this?
A lot of unfamiliar stuff it that code ...
;;; -*- lexical-binding: t -*-
;;
;; this file:
;; https://dataswamp.org/~incal/emacs-init/list.el
(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))) ))))
--
underground experts united
https://dataswamp.org/~incal
- Re: Easy to add with push but not to the end of a list, (continued)
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/12/05
- Re: Easy to add with push but not to the end of a list, Michael Heerdegen, 2022/12/05
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/12/05
- Re: Easy to add with push but not to the end of a list, Michael Heerdegen, 2022/12/05
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/12/06
- Re: Easy to add with push but not to the end of a list, Michael Heerdegen, 2022/12/06
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/12/06
- Re: Easy to add with push but not to the end of a list, Michael Heerdegen, 2022/12/08
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/12/29
- Re: Easy to add with push but not to the end of a list, Michael Heerdegen, 2022/12/31
- Re: Easy to add with push but not to the end of a list,
Emanuel Berg <=
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/12/06
- Re: Easy to add with push but not to the end of a list, Stefan Monnier, 2022/12/06
- Re: Easy to add with push but not to the end of a list, Michael Heerdegen, 2022/12/06