[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [ELPA] New package: transient
From: |
Drew Adams |
Subject: |
RE: [ELPA] New package: transient |
Date: |
Mon, 4 May 2020 09:04:06 -0700 (PDT) |
> > What's an alist? It's a list. What's a (true)
> > list? It's a sequence.
> > `copy-sequence' (aka `copy-seq') also copies an
> > alist.
>
> 'copy-sequence' is usually not an adequate way to copy an alist.
> It copies the backbone but not the associations.
> When you modify the associations -- which you presumably intend
> to do -- the two copies will both be changed.
>
> To copy an alist properly, you need to use 'copy-alist',
> and that is why we added that function.
Oh, right; forgot. Thx.
(setq foo '((a . A))) ; foo is ((a . A))
(setq titi (copy-alist foo)) ; titi is ((a . A))
(setcdr (car titi) 'AA) ; titi is ((a . AA))
foo is still ((a . A))
(setq bar (copy-sequence foo)) ; bar is ((a . A))
(setcdr (car bar) 'AA) ; bar is ((a . AA))
foo is now ((a . AA))
- Re: [ELPA] New package: transient, (continued)
- Re: [ELPA] New package: transient, 조성빈, 2020/05/02
- Re: [ELPA] New package: transient, Eli Zaretskii, 2020/05/02
- Re: [ELPA] New package: transient, 조성빈, 2020/05/02
- Re: [ELPA] New package: transient, Eli Zaretskii, 2020/05/02
- RE: [ELPA] New package: transient, Drew Adams, 2020/05/02
- RE: [ELPA] New package: transient, Drew Adams, 2020/05/02
- Re: [ELPA] New package: transient, Richard Stallman, 2020/05/03
- RE: [ELPA] New package: transient,
Drew Adams <=
- Re: [ELPA] New package: transient, Philippe Vaucher, 2020/05/02
- Re: [ELPA] New package: transient, João Távora, 2020/05/02
- Re: [ELPA] New package: transient, Philippe Vaucher, 2020/05/02
- Re: [ELPA] New package: transient, João Távora, 2020/05/02
- Re: [ELPA] New package: transient, Philippe Vaucher, 2020/05/02
- Re: [ELPA] New package: transient, João Távora, 2020/05/02
- Re: [ELPA] New package: transient, 조성빈, 2020/05/02
- Re: [ELPA] New package: transient, João Távora, 2020/05/02
- Re: [ELPA] New package: transient, 조성빈, 2020/05/02
- Re: [ELPA] New package: transient, João Távora, 2020/05/02