emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Wittern <cwittern@gmail.com>
To: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: help with porting babel example on worg to latest version
Date: Mon, 06 Jan 2014 16:03:05 +0900	[thread overview]
Message-ID: <52CA5529.2050705@gmail.com> (raw)

Hi there,

I am trying to understand how to use information from an org table as input 
for a babel function.
For this purpose, I looked at the example at 
http://orgmode.org/worg/org-contrib/babel/intro.html#arguments-to-source-code-blocks

It seems that this is using the old syntax, eg. #+tblname, which seems to be 
just #+name now.  But even with this change I can not reproduce the result.  
With the following code, I get the message "Symbol's value as variable is 
void: fib-inputs" when doing C-c on the src.  I am sure there are more 
changes I need to make, but I can't figure it out.  Any help appreciated.
Here is the code so far:

#+name: fibonacci-inputs
| 1 | 2 | 3 | 4 |  5 |  6 |  7 |  8 |  9 | 10 |
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |


#+name: fibonacci-seq(fib-inputs=fibonacci-inputs)
#+begin_src emacs-lisp
   (defun fibonacci (n)
     (if (or (= n 0) (= n 1))
         n
       (+ (fibonacci (- n 1)) (fibonacci (- n 2)))))

   (mapcar (lambda (row)
             (mapcar #'fibonacci row)) fib-inputs)
#+end_src


All the best,

Christian

-- 
Christian Wittern, Kyoto

             reply	other threads:[~2014-01-06  7:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06  7:03 Christian Wittern [this message]
2014-01-06  9:43 ` help with porting babel example on worg to latest version Bastien
     [not found] ` <1389004050.53626.YahooMailNeo@web171302.mail.ir2.yahoo.com>
2014-01-06 10:28   ` Miguel Ruiz
2014-01-06 12:00   ` patch for worg (was:Re: help with porting babel example on worg to latest version) Christian Wittern
2014-01-06 12:57     ` patch for worg Bastien

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=52CA5529.2050705@gmail.com \
    --to=cwittern@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).