On 05/21/2007 10:20 PM, Todd Wilson wrote:
Felix Breuer wrote:
A simple implementation that serves both purposes might look as
follows. Suppose snippets of code in the document are wrapped in an
environment like

  <lp-code|label|body>

where label is an arbitrary string that marks which snippets belong
together and body is an arbitrary TeXmacs tree that is "the code".

A slightly more general but useful extension of this would be to use two labels, one for "import" and one for "export". This would allow you to have multiple files/sessions that shared initial segments (i.e., file/session trees). For example,

    <lp-code||common|body0>
    <lp-code|common|branch1|body1>
    <lp-code|common|branch2|body2>

would create two files/sessions with bodies body0+body1 and body0+body2. This would be more in line with languages that have the means to do #include's, and would also make possible a kind of "exploratory" session, where different approaches to the main line can be highlighted and developed without interfering with the main-line development.

Todd Wilson

Let me translate what you want into noweb syntax.

%---BEGIN file.nw
blah blah blah

<<my imports>>=
some import statements go here
@

more blah blah

<<foo>>=
<<my imports>>
more code
@

even more blah blah

<<bar>>=
<<my imports>>
some other code
@

%---END file.nw

Here is what you get if you use notangle.

>notangle -Rfoo file.nw
some import statements go here
more code
>notangle -Rbar file.nw
some import statements go here
some other code
>


Do you see the difference to your two argument "lp-code"? Or am I missing your point?

Ralf


_______________________________________________
Texmacs-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/texmacs-dev

Reply via email to