emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About babel and header arguments


From: tomas
Subject: Re: About babel and header arguments
Date: Sun, 10 Apr 2022 12:11:50 +0200

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]