From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gareth Smith Subject: Re: How to ensure code blocks are run during export? Date: Mon, 06 May 2013 16:18:08 +0100 Message-ID: <87a9o82l3j.fsf@doc.ic.ac.uk> References: <86bo8sbggr.fsf@somewhere.org> <86txmk9uv6.fsf@somewhere.org> <86k3ng9qad.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZNBA-0008JC-F0 for emacs-orgmode@gnu.org; Mon, 06 May 2013 11:18:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZNB7-0007Xv-NE for emacs-orgmode@gnu.org; Mon, 06 May 2013 11:18:16 -0400 Received: from smtp2.cc.ic.ac.uk ([155.198.5.156]:59469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZNB7-0007Xh-H7 for emacs-orgmode@gnu.org; Mon, 06 May 2013 11:18:13 -0400 In-Reply-To: (Alan Schmitt's message of "Fri, 03 May 2013 15:08:34 +0200") 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: Alan Schmitt Cc: Sebastien Vauban , emacs-orgmode@gnu.org Alan Schmitt 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