|
From: | Todd Wilson |
Subject: | Re: [Texmacs-dev] Literate Programming in TeXmacs? |
Date: | Mon, 21 May 2007 13:20:06 -0700 |
User-agent: | Thunderbird 1.5.0.10 (X11/20070301) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |