I am trying to create the same structure that the block letaccepts for local variable definitions, but clicks on the wall: this function parse:
(defun parse (string)
(mapcar (lambda (line)
(let* ((k_v (split-string line "="))
(key (make-symbol (first k_v)))
(val (second k_v)))
(list key val)))
(split-string string "\n" t)))
I get what looks like the desired output in lisp -interaction-mode:
(setq alist (parse "foo=bar\nbaz=quux\n"))
((foo "bar") (baz "quux"))
Given that ...
(assq 'foo '((foo "bar") (baz "quux")))
(foo "bar")
... I would expect the same result below - what am I missing?
(assq 'foo alist)
nil
Although I would be surprised if the versions of Emacs mattered, I tested this in Emacs 24.2 (9.0) on OSX.
source
share