From: Dan Davison <davison@stats.ox.ac.uk>
To: Inquisitive Scientist <inquisitive.scientist@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: How do you use call and lob in org-babel?
Date: Thu, 05 Aug 2010 13:02:02 -0400 [thread overview]
Message-ID: <87lj8l0z91.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <AANLkTik5iYxh_wKgLSMhhWM-brXQNq0d7JoJgCUcBRGz@mail.gmail.com> (Inquisitive Scientist's message of "Thu, 5 Aug 2010 09:24:46 -0400")
Hi I.S.,
Inquisitive Scientist <inquisitive.scientist@gmail.com> 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
next prev parent reply other threads:[~2010-08-05 17:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 13:24 How do you use call and lob in org-babel? Inquisitive Scientist
2010-08-05 17:02 ` Dan Davison [this message]
2010-08-06 0:46 ` Eric Schulte
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=87lj8l0z91.fsf@stats.ox.ac.uk \
--to=davison@stats.ox.ac.uk \
--cc=emacs-orgmode@gnu.org \
--cc=inquisitive.scientist@gmail.com \
/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).