Alan Schmitt <[email protected]> writes: > Hi Sebastien, > > Sebastien Vauban writes: > >> I don't know OCaml at all, so I cannot try your example locally on my >> machine. > > And I don't know about other languages that support sessions, > unfortunately.
I can see something similar using haskell, if that helps: --8<---------------cut here---------------start------------->8--- # -*- org-confirm-babel-evaluate: nil -*- Setting the stage #+BEGIN_SRC haskell :results code verbatim :exports results let f = (+1) f 1 #+END_SRC Using the function #+BEGIN_SRC haskell :results code verbatim :exports results f 3 #+END_SRC Setting another stage #+BEGIN_SRC haskell :results silent :exports none let g = (+1) g 1 #+END_SRC Using the second function #+BEGIN_SRC haskell :results code verbatim :exports results g 3 #+END_SRC --8<---------------cut here---------------end--------------->8--- >> Though, you speak of "session": where is your session header argument? Isn't >> that the problem? > > There is a default session for Caml code, so one does not need this > argument. In my example, the function f is declared in one block and successfully used in the second. The function g is declared in a third (silent) block, and results in an error when we try to call it in the fourth and final block. Does this demonstrate the default "session" that Alan mentioned? G
