From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: How do you use call and lob in org-babel? Date: Thu, 05 Aug 2010 13:02:02 -0400 Message-ID: <87lj8l0z91.fsf@stats.ox.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=49501 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oh3pb-0002pl-9m for emacs-orgmode@gnu.org; Thu, 05 Aug 2010 13:02:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oh3pY-0002pZ-F9 for emacs-orgmode@gnu.org; Thu, 05 Aug 2010 13:02:09 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:37104) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oh3pY-0002p6-7l for emacs-orgmode@gnu.org; Thu, 05 Aug 2010 13:02:08 -0400 In-Reply-To: (Inquisitive Scientist's message of "Thu, 5 Aug 2010 09:24:46 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Inquisitive Scientist Cc: emacs-orgmode@gnu.org Hi I.S., Inquisitive Scientist writes: > Dear Experts, > > I am confused about how to use lob and call in org-babel. First I > define a simple function like square: > #+srcname: square(x) > #+begin_src python > return x*x > #+end_src > > A line like > : #+lob: square(x=2) > does not seem to produce any result either in the buffer or on export: > #+lob: square(x=2) > > The same seems to happen with call: > : #+call: square(x=2) > #+call: square(x=2) I'm not seeing this. The following works for me with C-c C-c on the lob/call lines. However, note that the #+call line will *appear* not to do anything as things stand, because it sees the existing results block created by the #+lob call. #+srcname: square(x) #+begin_src python return x*x #+end_src #+lob: square(x=2) #+results: square(x=2) : 4 #+call: square(x=2) Is the above definitely not working for you? What version of org are you using? Dan > > Instead, to get things to work I need to do something like: > : | 4 | > : #+TBLFM: @1$1='(sbe "square" (x 2)) > to get: > | 4 | > #+TBLFM: @1$1='(sbe "square" (x 2)) > > Thanks, > -I.S. > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode