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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

let-alist can't deal with the keys which includes spaces.


From: Hongyi Zhao
Subject: let-alist can't deal with the keys which includes spaces.
Date: Tue, 20 Jul 2021 19:12:14 +0800

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:

Debugger entered--Lisp error: (invalid-read-syntax ". in wrong context" 8 28)
  read(#<buffer *scratch*>)
  elisp--preceding-sexp()
  elisp--eval-last-sexp(t)
  eval-last-sexp(t)
  eval-print-last-sexp(nil)
  funcall-interactively(eval-print-last-sexp nil)
  call-interactively(eval-print-last-sexp nil nil)
  command-execute(eval-print-last-sexp)

It seems that let-alist can't deal with the keys which includes
spaces. Any hints for this problem will be highly appreciated.

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

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