more changes to og-worg, specifically "* Arguments to source code blocks"

This commit is contained in:
Eric Schulte 2009-08-09 12:43:59 -06:00
parent f6f514596a
commit a44766514e
1 changed files with 19 additions and 0 deletions

View File

@ -105,6 +105,12 @@ Inputs for fibonacci-seq
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
in the Org-mode buffer this looks like
: #+tblname: fibonacci-inputs
: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
: | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
[[http://www.gnu.org/software/emacs/manual/elisp.html][Emacs Lisp]] source code
#+srcname: fibonacci-seq
#+begin_src emacs-lisp :var fib-inputs=fibonacci-inputs
(defun fibonacci (n)
@ -116,6 +122,19 @@ Inputs for fibonacci-seq
(mapcar #'fibonacci row)) fib-inputs)
#+end_src
in the Org-mode buffer this looks like
: #+srcname: fibonacci-seq
: #+begin_src emacs-lisp :var fib-inputs=fibonacci-inputs
: (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
Results of Emacs Lisp code evaluation
#+resname:
| 1 | 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 | 55 |
| 1 | 3 | 8 | 21 | 55 | 144 | 377 | 987 | 2584 | 6765 |