I can't get this to play the meta game in an org-mode buffer
#+begin_src emacs-lisp
(defun print-elements-of-list (list)
"Print each element of LIST on a line of its own."
(while list
(print (car list))
(setq list (cdr list))))
#+end_src
#+RESULTS:
: print-elements-of-list
#+begin_src emacs-lisp
(setq animals '("gazelle" "giraffe" "lion" "tiger"))
#+end_src
#+RESULTS:
| gazelle | giraffe | lion | tiger |
#+begin_src emacs-lisp :results verbatim
animals
#+end_src
#+RESULTS:
: ("gazelle" "giraffe" "lion" "tiger")
#+name: animal_list
#+begin_src emacs-lisp :results output list
(print-elements-of-list animals)
#+end_src
#+RESULTS: animal_list
: - "gazelle"
: - "giraffe"
: - "lion"
: - "tiger"
#+begin_src emacs-lisp :var alist=animal_list() :results list
alist
#+end_src
#+RESULTS:
: - "gazelle"
: - "giraffe"
: - "lion"
: - "tiger"
#+begin_src emacs-lisp :var alist=animal_list()
(mapcar (lambda (x) (concat x "foo")) alist)
#+end_srcI'm getting an error from evaluating the last block:
Wrong type argument: sequencep, 10.
I'm fairly sure that
alist by this point is not actually an elisp list. But what does
animal_list() contain then? It's the output of my
print-elements-of-list function. Is there a way to "look under the hood" at what a named block
animal_list() contains?
--
⨽
Lawrence Bottorff
Grand Marais, MN, USA