Alan Schmitt writes: > 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; It is not a function name, it is a code block name. See the noweb section of the Org-mode manual for more information. > > - 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 > > 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. >