From: <tomas@tuxteam.de>
To: emacs-orgmode@gnu.org
Subject: Re: About babel and header arguments
Date: Sun, 10 Apr 2022 12:11:50 +0200 [thread overview]
Message-ID: <YlKtZjUGvQeH/rsy@tuxteam.de> (raw)
In-Reply-To: <CAO0LSb7USQXe2YbhcRc6LbwPDb5EUJHkuc3a+sQhX+tsKaE7fA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 975 bytes --]
On Sun, Apr 10, 2022 at 11:53:51AM +0200, Henrik Frisk wrote:
> Hi,
>
> I'm not a skilled (scheme) programmer so maybe there is something obvious
> I'm missing here. In the first example the header argument y is interpreted
> as I would expect it, but in the second it isn't:
Hm. You are expecting (12 10)?
> #+begin_src scheme :var y=10 :results value
> (+ 10 y)
> #+end_src
>
> #+RESULTS:
> : 10
>
> but not this:
>
> #+begin_src scheme :var y=10 :results output
> ((lambda (x) (display x)) '(12 y))
> #+end_src
The quote extends to the whole (parenthesized) expression, i.e.
the y is quoted too, in there, so it's the symbol y, so that
output is correct:
> #+RESULTS:
> : (12 y)
(That's Scheme, not Babel doing it). I don't know where you
want to go to, but perhaps try:
(list 12 y)
instead: this would make a list of whatever 12 evaluates to (this
would be 12) and y evaluates to (this would be 10).
Cheers
--
t
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2022-04-10 10:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-10 9:53 About babel and header arguments Henrik Frisk
2022-04-10 10:11 ` tomas [this message]
2022-04-10 10:39 ` Henrik Frisk
2022-04-10 11:18 ` Byung-Hee HWANG
2022-04-10 15:00 ` Neil Jerram
2022-04-10 15:37 ` tomas
2022-04-10 15:46 ` Neil Jerram
2022-04-11 11:36 ` Henrik Frisk
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=YlKtZjUGvQeH/rsy@tuxteam.de \
--to=tomas@tuxteam.de \
--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).