From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: How do I chain babel blocks with arguments? Date: Thu, 17 Apr 2014 13:37:15 +0200 Message-ID: References: <87r44wdzix.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WakdM-0008Lr-PO for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 07:37:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WakdG-0008Iu-NR for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 07:37:36 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:19317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WakdG-0008Il-HF for emacs-orgmode@gnu.org; Thu, 17 Apr 2014 07:37:30 -0400 In-Reply-To: <87r44wdzix.fsf@gmail.com> (Thorsten Jolitz's message of "Thu, 17 Apr 2014 12:24:38 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Jolitz Cc: emacs-orgmode@gnu.org On 2014-04-17 12:24, Thorsten Jolitz writes: > Alan Schmitt 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