On Wed, Jun 03, 2009 at 06:45:41PM +0200, Emmanuel Godard wrote:
> 
> 
> John Velman a écrit :
> I'm not sure I understand exactly what what you are trying to do but...

What I want to do is write a single file which:

   1. can be directly processed to produce a formatted document, and

   2. can be directly processed to produce a running program.

In Haskell, one writes a plain LaTeX file where source code is marked off
from the surrounding environment.

Prolog, being a declarative language, allows the presentation of the
different statements to be made in any order convenient for organizing the
explanation -- something that can also be done with Haskell, a purely
functional language.

With txt2tags, one is not limited to LaTeX, of course, and this is another
plus.

On reading the Wikipedia entry on "Literate Programming", I see that what I
seek is more properly called "semi-literate programming".  Please see that
article for an explanation of the difference. 

With that out of the way, Thanks! for your response. Although I've used Vim
regular expressions for fairly complex changes, when I read "Python regular
expressions"  the beginning of line ^ didn't come to mind.  I'm somewhat
embarrassed.   Also, I'd missed the %%% comment blocks in 2.5.

Now with your answer setting my mind in motion (hopefully), it appears that
I can get pretty much what I want by using the preprocessor fairly simply
together with a little source code discipline with almost any language.

> >
...
> > Question:  Using the current built in preproc filter, can one just set the
> > first % in a line to "", and thus eliminate the need for a separate
> > pre-process filter?
> > 
> yes of course:
> %!preproc: "^%" ""
> ^ stand for the beginning of the line in python regular expressions.
> > My goal would be to not have to pre-process the source code file, since in
> > development there may be many compile-test-compile-test-compile-test
> > cycles.
> > 
> 
> Maybe it is not related to your question, but do not forget the %%% mark 
> that delimits a commented section in txt2tags. Adding/removing such a 
> mark at the beginning of your text would conveniently swap commented 
> sections from comments to code.

Yes, this could be very convenient.

Thanks again,

John V.

> 
> Cheers,
> -- 
> Emmanuel
> 
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
> looking to deploy the next generation of Solaris that includes the latest 
> innovations from Sun and the OpenSource community. Download a copy and 
> enjoy capabilities such as Networking, Storage and Virtualization. 
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> txt2tags-list mailing list
> https://lists.sourceforge.net/lists/listinfo/txt2tags-list

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Reply via email to