From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Ruiz Subject: Re: help with porting babel example on worg to latest version Date: Mon, 6 Jan 2014 10:28:43 +0000 (GMT) Message-ID: <1389004123.32911.YahooMailNeo@web171306.mail.ir2.yahoo.com> References: <52CA5529.2050705@gmail.com> <1389004050.53626.YahooMailNeo@web171302.mail.ir2.yahoo.com> Reply-To: Miguel Ruiz Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="-1132928367-1764662499-1389004123=:32911" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W07QS-0008Cl-Ru for emacs-orgmode@gnu.org; Mon, 06 Jan 2014 05:28:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W07QM-0003ns-7T for emacs-orgmode@gnu.org; Mon, 06 Jan 2014 05:28:52 -0500 Received: from nm23.bullet.mail.ir2.yahoo.com ([212.82.96.47]:40659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W07QL-0003nj-PV for emacs-orgmode@gnu.org; Mon, 06 Jan 2014 05:28:46 -0500 In-Reply-To: <1389004050.53626.YahooMailNeo@web171302.mail.ir2.yahoo.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" ---1132928367-1764662499-1389004123=:32911 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable What's the problem with:=0A=0A=0A#+name: fibonacci-inputs=0A| 1 | 2 | 3 | 4= |=A0 5 |=A0 6 |=A0 7 |=A0 8 |=A0 9 | 10 |=0A| 2 | 4 | 6 | 8 | 10 | 12 | 14= | 16 | 18 | 20 |=0A=0A=0A#+name: fibonacci-seq=0A#+begin_src emacs-lisp :v= ar fib-inputs=3Dfibonacci-inputs=0A=A0 (defun fibonacci (n)=0A=A0=A0=A0 (if= (or (=3D n 0) (=3D n 1))=0A=A0=A0=A0=A0=A0=A0=A0 n=0A=A0=A0=A0=A0=A0 (+ (f= ibonacci (- n 1)) (fibonacci (- n 2)))))=0A=0A=A0 (mapcar (lambda (row)=0A= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (mapcar #'fibonacci row)) fib-inputs)=0A#= +end_src=0A=0A#+RESULTS:=0A fibonacci-seq=0A| 1 | 1 | 2 |=A0 3 |=A0 5 |=A0= =A0 8 |=A0 13 |=A0 21 |=A0=A0 34 |=A0=A0 55 |=0A| 1 | 3 | 8 | 21 | 55 | 144= | 377 | 987 | 2584 | 6765 |=0A=0A?=0A=0A=0A=0A=0A=0AEl Lunes 6 de enero de= 2014 8:03, Christian Wittern escribi=F3:=0A =0AHi the= re,=0A=0AI am trying to understand how to use information from an org table= as input =0Afor a babel function.=0AFor this purpose, I=0A looked at the e= xample at =0Ahttp://orgmode.org/worg/org-contrib/babel/intro.html#arguments= -to-source-code-blocks=0A=0AIt seems that this is using the old syntax, eg.= #+tblname, which seems to be =0Ajust #+name now.=A0 But even with this cha= nge I can not reproduce the result.=A0 =0AWith the following code, I get th= e message "Symbol's value as variable is =0Avoid: fib-inputs" when doing C-= c on the src.=A0 I am sure there are more =0Achanges I need to make, but I = can't figure it out.=A0 Any help appreciated.=0AHere is the code so far:=0A= =0A#+name: fibonacci-inputs=0A| 1 | 2 | 3 | 4 |=A0 5 |=A0 6 |=A0 7 |=A0 8 |= =A0 9 | 10 |=0A| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |=0A=0A=0A#+na= me: fibonacci-seq(fib-inputs=3Dfibonacci-inputs)=0A#+begin_src emacs-lisp= =0A=A0 (defun fibonacci (n)=0A=A0=0A =A0 (if (or (=3D n 0) (=3D n 1))=0A= =A0 =A0 =A0 =A0 n=0A=A0 =A0 =A0 (+ (fibonacci (- n 1)) (fibonacci (- n 2)= ))))=0A=0A=A0 (mapcar (lambda (row)=0A=A0 =A0 =A0 =A0 =A0 =A0 (mapcar #'f= ibonacci row)) fib-inputs)=0A#+end_src=0A=0A=0AAll the best,=0A=0AChristian= =0A=0A-- =0AChristian Wittern, Kyoto ---1132928367-1764662499-1389004123=:32911 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
What's th= e problem with:

= #+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
#+begin_src emacs-lisp :var fib-inputs=3Dfi= bonacci-inputs
  (defun fibonacci (n)
    (if (or (=3D n 0) (=3D n 1))
 = ;       n
   = ;   (+ (fibonacci (- n 1)) (fibonacci (- n 2)))))

  (mapcar (lambda (row)
 =            (mapcar #'fibo= nacci row)) fib-inputs)
#+end_src

#+RESULTS:=0A fibonacci-seq
| 1 | 1 | 2 |&n= bsp; 3 |  5 |   8 |  13 |  21 |   34 |&n= bsp;  55 |
| 1 | 3 | 8 | 21 | 55 | 144 | 377 | 987 |= 2584 | 6765 |

?



El Lunes 6 de enero de 2014 = 8:03, Christian Wittern <cwittern@gmail.com>=0A escribi=F3:
Hi t= here,

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

It seem= s that this is using the old syntax, eg. #+tblname, which seems to be
just #+name now.  But even with this change I can not re= produce the result. 
With the following code, I get= the message "Symbol's value as variable is
void: fib-in= puts" 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-inpu= ts=3Dfibonacci-inputs)
#+begin_src emacs-lisp
  (defun fibonacci (n)
 =0A   (if= (or (=3D n 0) (=3D n 1))
        n<= br clear=3D"none">      (+ (fibonacci (- n 1)) (fibonacci (= - n 2)))))

  (mapcar (lambda (ro= w)
            (mapcar #'f= ibonacci row)) fib-inputs)
#+end_src

All the best,

Christian

--
Christian Wittern, Kyoto






=
---1132928367-1764662499-1389004123=:32911--