[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: let-alist can't deal with the keys which includes spaces.
From: |
tomas |
Subject: |
Re: let-alist can't deal with the keys which includes spaces. |
Date: |
Tue, 20 Jul 2021 18:20:13 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Jul 20, 2021 at 05:35:22PM +0200, Omar Polo wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > I adapted the examples given on
> > <https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html>
> > to the following:
> >
> > ;;;
> > (setq colors '(("rose merry" . red) (lily (belladonna . yellow))))
> >
> > (let-alist colors
> > (if (eq ."rose merry" 'red)
> > .lily.belladonna))
> > ;;;
[...]
> Strings and symbols are different data types and such have different
> properties and different syntax.
yes, and `let-alist' expects symbols as keys.
> Moreover, I don't know how wise is to use strings as alist keys (symbols
> are interned, strings doesn't necessary). I suggest using something
> like
In the general case, you can use strings (and other Lisp objects) as keys
in an alist. You have to use the right functions (i.e. `assoc' for the
strings, which by default uses `equal' as equality predicate).
But not for `let-alist'.
Cheers
- t
signature.asc
Description: Digital signature
- let-alist can't deal with the keys which includes spaces., Hongyi Zhao, 2021/07/20
- Re: let-alist can't deal with the keys which includes spaces., tomas, 2021/07/20
- Re: let-alist can't deal with the keys which includes spaces., Omar Polo, 2021/07/20
- Re: let-alist can't deal with the keys which includes spaces.,
tomas <=
- Re: let-alist can't deal with the keys which includes spaces., Emanuel Berg, 2021/07/20
- Re: let-alist can't deal with the keys which includes spaces., tomas, 2021/07/20
- Re: let-alist can't deal with the keys which includes spaces., Emanuel Berg, 2021/07/20
- Re: let-alist can't deal with the keys which includes spaces., Emanuel Berg, 2021/07/20
- Re: let-alist can't deal with the keys which includes spaces., tomas, 2021/07/21
- Re: let-alist can't deal with the keys which includes spaces., Emanuel Berg, 2021/07/21