emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Inquisitive Scientist <inquisitive.scientist@gmail.com>
To: emacs-orgmode@gnu.org
Subject: debugging sbe calls
Date: Thu, 5 Aug 2010 08:42:00 -0400	[thread overview]
Message-ID: <AANLkTi=R0G5a8fGFDrShp5Mjn8prjjFddrVaf6gJNcfY@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1738 bytes --]

Dear Experts,

I *love* org-babel. In trying to switch a bunch of things to using it, I
have run into the problem that if I get the syntax slightly wrong, either
nothing happens (no output) or I just get something like "ERROR". Is there a
way to understand what is causing the error? So far, I have resorted to
creating a checklist of common mistakes which I run through whenever
something doesn't work. I think many of these look like things which could
in theory be detected and warned or complained about. Any suggestions on
debugging would be much appreciated.

Below is a list of some common mistakes.

** common mistakes

*** forgetting colon on srcname

If you do the following (note the missing colon on srcname)

#+srcname Cube(x=3)
#+begin_src python :results value :export code
return x*x*x
#+end_src

then things won't work (e.g., you may get an error about "global name
'x' is not defined" which is pretty confusing).

Instead, make sure you have the colons and do

#+srcname: Cube(x=3)
#+begin_src python :results value :export both
return x*x*x
#+end_src

which gives

#+results: Cube
: 27

*** forgetting = in chained sbe call

Make sure you include the = sign in a chained sbe call like the
following:

| 512 |
#+TBLFM: @1$1='(sbe "Cube" (x "Cube(x=2)"))

If you forget the = as in
| 19683 |
#+TBLFM: @1$1='(sbe "Cube" (x "Cube(x 1)"))

or if you forget a quote as in
| #ERROR |
#+TBLFM: @1$1='(sbe "Cube" (x "Cube(x=2)))
it won't work.

*** getting confused on sbe call

It's common to forget that the sbe syntax uses pairs *without* the
equal sign. Consequently, something like
| #ERROR |
#+TBLFM: @1$1='(sbe "Cube" (x=2))

won't work but something like

| 8 |
#+TBLFM: @1$1='(sbe "Cube" (x 2))

will do what you want.

[-- Attachment #1.2: Type: text/html, Size: 2096 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

             reply	other threads:[~2010-08-05 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05 12:42 Inquisitive Scientist [this message]
2010-08-06  8:20 ` debugging sbe calls Sébastien Vauban
2010-08-06  9:53   ` Dan Davison
2010-08-08 11:16 ` David Maus

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='AANLkTi=R0G5a8fGFDrShp5Mjn8prjjFddrVaf6gJNcfY@mail.gmail.com' \
    --to=inquisitive.scientist@gmail.com \
    --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).