emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How to ensure code blocks are run during export?


From: Gareth Smith
Subject: Re: [O] How to ensure code blocks are run during export?
Date: Mon, 06 May 2013 16:18:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Alan Schmitt <address@hidden> 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



reply via email to

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