emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] input data for babel blocks


From: Alan Schmitt
Subject: Re: [O] input data for babel blocks
Date: Tue, 01 Oct 2013 10:12:01 +0200
User-agent: mu4e 0.9.9.5; emacs 24.3.1

Hi Charles,

address@hidden 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
>   <<elisp-conversion-to-mylang("arg1","arg2")>>
> #+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



reply via email to

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