On Tue, Jul 20, 2021 at 09:21:32PM +0800, Hongyi Zhao wrote: > On Tue, Jul 20, 2021 at 8:49 PM wrote: > > > > On Tue, Jul 20, 2021 at 07:12:14PM +0800, Hongyi Zhao wrote: > > > I adapted the examples given on > > > > > > 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 dot syntax is described on > , > as follows: > > Macro: let-alist alist body > > Creates a binding for each symbol used as keys the association list > alist [...] Oh -- thanks. Didn't know about `let-alist'. But if I read it correctly, the macro wants to have symbols as keys, not other types (like strings). Note the snippet of the doc quote above. This works for me: (setq colors '((rose . "red") (lily . "white") (sunflower . "yellow"))) (let-alist colors (format "a lily is %S\n" .lily)) => a lily is "white" It seems `let-alist' gets horribly confused if it tries to build a variable binding from a string. Cheers - t