emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How do I chain babel blocks with arguments?


From: Alan Schmitt
Subject: Re: [O] How do I chain babel blocks with arguments?
Date: Thu, 17 Apr 2014 13:37:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

On 2014-04-17 12:24, Thorsten Jolitz <address@hidden> writes:

> Alan Schmitt <address@hidden> writes:
>
>>> #+name:test2 
>>> #+begin_src emacs-lisp :var z="bar"
>>>   (let ((y (org-sbe test1 (x (intern z)))))
>>>     y)
>>> #+end_src
>>
>> Thank you for the suggestion, but it returns a symbol and not the
>> string. In the more complex setting I'm playing with I need a string
>> there.
>
> w/o knowing what this thread is about (since I did not follow it) I
> would say that all you need is
>
> ,----------------
> | (symbol-name y)
> `----------------
>
> as last expression.

Thanks, this helped me much!

So the solution is to use "eval", which seems to be interpreted by
org-sbe:

--8<---------------cut here---------------start------------->8---
#+name: test1
#+begin_src emacs-lisp :var x="foo"
x
#+end_src

#+name: test2
#+begin_src emacs-lisp :var z="bar"
  (let ((y (org-sbe test1 (x (eval z)))))
    y)
#+end_src

#+results: test2
: bar

#+call: test2(z="baz")

#+results:
: baz
--8<---------------cut here---------------end--------------->8---

I still would really like what can (and cannot) be done with sbe, but
this should be enough to let me make progress.

Thanks again,

Alan



reply via email to

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