* Org-mode meta results
@ 2023-02-18 4:51 Galaxy Being
0 siblings, 0 replies; only message in thread
From: Galaxy Being @ 2023-02-18 4:51 UTC (permalink / raw)
To: emacs-orgmode Mailinglist
[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]
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_src
I'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
borgauf@gmail.com
[-- Attachment #2: Type: text/html, Size: 2234 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-18 4:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-18 4:51 Org-mode meta results Galaxy Being
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).