---------- Forwarded message ----------
From: daly <daly@axiom-developer.org>
Date: Mon, Mar 28, 2011 at 12:18 PM
Subject: Common Lisp replacement for noweb
To: thomas.m.hermann@odonata-research.com, pro@common-lisp.net


I have moved from using noweb to a pure Common Lisp version
of literate programming. (The source is also at:
http://literatesoftware.com/tangle.lisp )

The noweb program uses two functions,
 weave -- takes a file and extracts latex
 tangle - takes a file and extracts running code

The noweb syntax is:
 <<thechunk>>=
   your source code
 @

where your code is defined in the block delimited by the
<<...>>= and the @ symbol. To use the delimited chunk
somewhere you write the name of the chunk as:
 <<thechunk>>


It would be better to use a valid latex environment.
That would mean that there is no need for a "weave" function
since the original file is valid latex.

\begin{chunk}{thechunk}
  your code here
\end{chunk}

\getchunk{thechunk}

All that would be left is to make Common Lisp understand
the latex environment syntax which is trivial to do. So I
wrote a tangle.lisp program. It accepts and processes both
the old noweb syntax and the new latex syntax.

The idea is simple. Read the file, hash the chunks, and
expand them when a getchunk is found.

The code is attached.

Send questions to daly@literatesoftware.com

Tim Daly
daly@axiom-developer.org
daly@literatesoftware.com