From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: input data for babel blocks Date: Tue, 01 Oct 2013 10:12:01 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQv3z-0002gP-KS for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 04:12:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQv3t-0006Rw-0d for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 04:12:11 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:31296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQv3s-0006RR-RB for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 04:12:04 -0400 In-reply-to: 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: Charles Berry Cc: emacs-orgmode@gnu.org Hi Charles, ccberry@ucsd.edu writes: > Lacking that, another alternative to the approach you have crafted is to > use elisp src blocks to set up the commands needed to create the objects, > and then place the results of executing the elisp src block in the src > block of your favored language using noweb, for example > > #+BEGIN_SRC mylang :noweb yes > <> > #+END_SRC > > might convert 'arg2' to an object of the desired type named 'arg1' in a > 'mylang' src block. This looks like a very powerful approach, but it's a bit beyond my understanding of babel (which is limited) and noweb (whose existence I just discovered after reading http://orgmode.org/manual/noweb.html). The way I understand it is: - there is somewhere in the file a "elisp-conversion-to-mylang" function; - upon export or evaluation or tangling, it will be expanded in the body of the source block; - it will then be evaluated in the source block. What I don't understand is: - how to define this function; - will it be evaluated as a "mylang" function or as a function in the language it is defined? In other words, do we have "evaluate elisp-conversion-to-mylang in its language then substitute the results in the noweb block" or "substitute the function in the noweb block then evaluate it"? If you have an example that uses different languages, I'd love to look at it. I'll then try to write an example for ocaml. Thanks, Alan