emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: "Blanchette, Marco" <MAB@stowers.org>
Cc: Dan Davison <davison@stats.ox.ac.uk>,
	nicholas.dokos@hp.com,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Re: Problem whit with code evaluation
Date: Thu, 19 Aug 2010 01:05:41 -0400	[thread overview]
Message-ID: <15801.1282194341@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from "Blanchette, Marco" <MAB@stowers.org> of "Wed, 18 Aug 2010 22:01:23 CDT." <C89208B3.16D0C%mab@stowers.org>

Blanchette, Marco <MAB@stowers.org> 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 "<stdin>", line 5, in <module>
>   File "<stdin>", 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" <davison@stats.ox.ac.uk> 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

  parent reply	other threads:[~2010-08-19  5:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19  0:12 Problem whit with code evaluation Blanchette, Marco
2010-08-19  2:37 ` Dan Davison
2010-08-19  3:01   ` Blanchette, Marco
2010-08-19  4:23     ` Dan Davison
2010-08-19  5:05     ` Nick Dokos [this message]
2010-08-19 13:38       ` Dan Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15801.1282194341@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=MAB@stowers.org \
    --cc=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).