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 15:01:10 +0200 Message-ID: References: <87r4c5p456.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQzZn-00072N-Jh for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 09:01:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQzZh-0001Sd-HV for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 09:01:19 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:30107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQzZh-0001SZ-Bj for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 09:01:13 -0400 In-reply-to: <87r4c5p456.fsf@gmail.com> 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: Eric Schulte Cc: emacs-orgmode@gnu.org, Charles Berry Hi Eric, schulte.eric@gmail.com writes: >> What I don't understand is: >> - how to define this function; > > It is not a function name, it is a code block name. See the noweb > section of the Org-mode manual for more information. OK. >> - 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"? >> > > see above I'm sorry, I don't see the answer to this above. The only example I could find in the manual is this one http://orgmode.org/manual/noweb_002dref.html#noweb_002dref which does not address using noweb with different languages. I did some experiments and I'm even more confused. Here is a test where I want to feed the results of "ls" in a shell block as an ocaml list. This is what I tried: --8<---------------cut here---------------start------------->8--- #+BEGIN_SRC sh :noweb-ref testing echo "[" for i in `ls`; do echo \"$i;\" done echo "]" #+END_SRC #+BEGIN_SRC ocaml :noweb yes let x = <> in x #+END_SRC --8<---------------cut here---------------end--------------->8--- This is clearly wrong because this is what ends up in the toplevel: --8<---------------cut here---------------start------------->8--- let x = echo "[" for i in `ls`; do echo \"$i;\" done echo "]" in x;; --8<---------------cut here---------------end--------------->8--- (I would have like the code to be executed, and the raw results to replace the <> ref.) So I'll rephrase my question: how can I use noweb with different languages? Thanks, Alan