[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] babel header arguments tutorial?

From: Lawrence Bottorff
Subject: Re: [O] babel header arguments tutorial?
Date: Sun, 27 Sep 2015 16:28:25 +0000

I guess from a purely elisp perspective I'm baffled. How is

#+begin_src emacs-lisp

supposed to produce

| (:session . foo) |

as it supposedly does in the doc? It doesn't for me. (Where, e.g., would "foo" be coming from?) If it had worked, does it make an addition to some hash table, or an alist somewhere? But then running this as an elisp code block is cool from a declarative programming standpoint (see this) . So this

# Local Variables:
# eval: (setq-local org-babel-default-header-args:Python '((:session . "foo")))
# End:

is called when you eval-buffer or open the file? 

Ancillary questions:
1. can babel elisp (or CL) blocks be assigned/associated to a specifically named session? That would enable various elisp code blocks to have separate "session spaces" (as does the geiser/scheme babel). If so, I'm guessing the block-session communication could also be remote? Again, with babel geiser/scheme sessions, can they call "cached" things from each other's different sessions?

2. . . . which makes me wonder how code blocks in a buffer can be run besides manually C-c C-c ing them. For example,

#+name: myexptdouble
#+begin_src emacs-lisp :session
(defun myexptdouble (x y)
  (* (myexpt x y) (myexpt x y)))

#+RESULTS: myexptdouble
: myexptdouble

#+name: myexpt
#+begin_src emacs-lisp :session
(defun myexpt (x y)
  (expt x y))

#+BEGIN_SRC emacs-lisp :results output raw
(myexptdouble 2 3)

Even if I manually evaluate myexptdouble, running the last block gives an error about not knowing what myexpt is. Is there something in the last block that can be told to evaluate all the dependent functions? Perhaps if my blocks are named the same as the function name? How tangling and preserving sessions is also an interesting question, IHMO.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]