[Top][All Lists]

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

[O] :noweb expansion happens before :prologue expansion. Why?

From: Vladimir Nikishkin
Subject: [O] :noweb expansion happens before :prologue expansion. Why?
Date: Wed, 21 Aug 2019 13:50:51 +0800

Hello, everyone

I wanted to do the following
#+name: common
#+begin_src scheme
(display "Common header\n")

#+begin_src scheme :noweb yes :prologue "<<common>>"
(display "particular block")

This fails, because :prologue is language-specific, and is expanded
later than :noweb, so I am getting <<common>> in my code rather than
the expansion.

Why? Only four language modules care to implement :prologue (R,
scheme, maxima, gnuplot) , and all of them do it by just concatenating
it with the rest of the code, and as a result the wonderful
possibility of attaching common headers to blocks is greatly reduced,
since they are not expanded at all.

Would it make more sense to expand the :prologue and :epilogue
_before_ :noweb rather than after and do it in a uniform way (that is,
simply concatenate)?

I am ready to make a patch, as long as it won't be rejected.

Yours sincerely, Vladimir Nikishkin

reply via email to

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