From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Re: Problem whit with code evaluation Date: Thu, 19 Aug 2010 01:05:41 -0400 Message-ID: <15801.1282194341@gamaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=60594 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OlxK7-0002ds-4s for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 01:05:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OlxK5-0003i3-Uw for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 01:05:55 -0400 Received: from vms173003pub.verizon.net ([206.46.173.3]:40194) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlxK5-0003hv-Q7 for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 01:05:53 -0400 Received: from gamaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173003.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0L7D002Q5VHH4I90@vms173003.mailsrvcs.net> for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 00:05:42 -0500 (CDT) In-reply-to: Message from "Blanchette, Marco" of "Wed, 18 Aug 2010 22:01:23 CDT." 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: "Blanchette, Marco" Cc: Dan Davison , nicholas.dokos@hp.com, "emacs-orgmode@gnu.org" Blanchette, Marco wrote: > Hmm... Thanks Dan. > > Do we have a different version of org-mode? I just pasted your code in emacs > and try to execute it with M-x org-babel-execute-buffer RET without success. > > The emacs-lisp code works but the python and the R crashes with the > following errors taken from the *Org-Babel Error* Output buffer > > Traceback (most recent call last): > File "", line 5, in > File "", line 3, in main > NameError: global name 'x' is not defined > Error in main() : object 'x' not found > > On 8/18/10 9:37 PM, "Dan Davison" wrote: > > > * The python example > > #+source: square(x) > > #+begin_src python > > return x*x > > #+end_src > > > > #+call: square(x=6) > > > > #+results: square(x=6) > > : 36 > > I think that's because the first source block cannot be evaluated: it only makes sense when it is #+called. If you place the cursor in that first source block and press C-c C-c, you get exactly the same error. If you do the same on the #+call, it works. Since org-babel-execute-buffer just steps through the buffer and executes every source block, it's not too surprising that you get those errors. So I guess the question is whether org-babel-execute-buffer should be smarter about which source blocks to execute. Nick