help-gnu-emacs
[Top][All Lists]
Advanced

[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 14:49:04 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jul 20, 2021 at 07:12:14PM +0800, Hongyi Zhao wrote:
> 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))
> ;;;
> 
> When I try to evaluate the above code snippet, the following error is 
> triggered:

It's not the space. It's the dot ".". This is wrong Lisp syntax:

  (eq ."rose merry" 'red)

Also the dots in .lily.belladonna look strange. This will be the next
syntax error.

BTW., if you take the dot out, like so

  (eq "rose merry" 'red)

the syntax will be correct, but the expression itself won't make much
sense, because it will always be false. The string "rose merry" can't
ever be `eq' to the symbol 'red.

What are you trying to achieve?

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]