From: Galaxy Being <borgauf@gmail.com>
To: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Org-mode meta results
Date: Fri, 17 Feb 2023 22:51:52 -0600 [thread overview]
Message-ID: <CAFAhFSXfPB4O9ViqNntnm_WwAhNJhSBu7LfYdJCUnK-UHNmS6w@mail.gmail.com> (raw)
[-- 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 --]
reply other threads:[~2023-02-18 4:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFAhFSXfPB4O9ViqNntnm_WwAhNJhSBu7LfYdJCUnK-UHNmS6w@mail.gmail.com \
--to=borgauf@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).