From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Literate Programming [was: A case where ...]
Date: 14 Jan 2002 09:34:03 -0500
Date: 2002-01-14T14:38:10+00:00 [thread overview]
Message-ID: <uita5dmsk.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: a1o2gr$sfe3f$1@ID-25716.news.dfncis.de
"Nick Roberts" <nickroberts@adaos.worldonline.co.uk> writes:
> What I think just be might be a worthwhile feature to add to a future
> revision would be some kind of line-oriented Ada 'on/off switch'.
> <snip>
> A file could then contain e.g.
>
> === docbook
>
> <para>The next function returns the opposite direction
> to the one given as its parameter.</para>
>
> === ada
>
> function Opposite (Way: in Direction) return Direction;
>
> === docbook
>
> <para>The next function ...
>
> This would mean that normal text files could be used to contain mixed
> content, including Ada source code, and yet any standard Ada compiler could
> directly compile such files.
It is tempting to put documentation in the code files, and it works
well when the system has only a few code files. But when you have 100
files, most of them small child subprograms, where do you look for the
documentation that describes the whole system?
I prefer to keep documentation in a separate file, but in the same
directory as the code (or at least the same directory tree), and build
it from the same makefile (I use LaTeX for documents).
> This would be a huge advantage over having to pre-process ('tangle')
> the files before compiling them, which tends to render the automatic
> 'make' tools supplied with Ada systems useless.
Preprocessors do not render Ada make tools useless. The preprocessor
just requires it's own 'make' step, which is easy to handle with a
generic make (such as gnu make). The generic makefile does two things;
check that all the preprocessed files are up-to-date, and then invoke
the Ada make to check that the object files are up-to-date. I've used
this technique with GNAT and ObjectAda.
One thing preprocessors do screw up is the interface between an editor
and the compiled information, used for cross-referencing code. For
example, Emacs Ada mode + GNAT normally allows a single keystroke to
bring up the source code for any definition. However, if the GNAT
preprocessor is used, that keystroke brings up the preprocessor
_output_ file, but we want the preprocessor _input_ file. In this
particular case, the GNAT compiler and preprocessor already provide
the necessary information; the Emacs Ada mode does not properly use
it (one of these days I'll fix it :).
--
-- Stephe
next prev parent reply other threads:[~2002-01-14 14:34 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-03 20:29 A case where Ada defaults to unsafe? Hyman Rosen
2002-01-03 20:38 ` Darren New
2002-01-03 21:36 ` Hyman Rosen
2002-01-04 14:29 ` Wes Groleau
2002-01-03 21:27 ` James Rogers
2002-01-03 21:32 ` Frank J. Lhota
2002-01-03 21:51 ` Hyman Rosen
2002-01-03 22:22 ` Ted Dennison
2002-01-03 23:07 ` Hyman Rosen
2002-01-03 23:38 ` Nick Williams
2002-01-04 0:15 ` Florian Weimer
2002-01-04 7:40 ` Preben Randhol
2002-01-04 14:39 ` Wes Groleau
2002-01-04 15:16 ` Ted Dennison
2002-01-04 3:35 ` Eric Merritt
2002-01-04 14:39 ` Robert A Duff
2002-01-04 14:27 ` Robert A Duff
2002-01-04 15:39 ` Larry Kilgallen
2002-01-04 15:57 ` Ted Dennison
2002-01-04 16:05 ` Ted Dennison
2002-01-10 21:22 ` Robert A Duff
2002-01-11 9:14 ` Dmitry A. Kazakov
2002-01-04 16:19 ` Brian Rogoff
2002-01-04 16:31 ` Ted Dennison
2002-01-08 20:55 ` Mark Lundquist
2002-01-16 0:14 ` Matthew Heaney
2002-01-16 20:19 ` Robert A Duff
2002-01-10 21:29 ` Robert A Duff
2002-01-11 9:25 ` Dmitry A. Kazakov
2002-01-19 0:35 ` Brian Rogoff
2002-01-19 14:15 ` Robert A Duff
2002-01-19 23:10 ` Brian Rogoff
2002-01-04 16:29 ` Robert Dewar
2002-01-04 17:32 ` Hyman Rosen
2002-01-04 18:50 ` Matthew Heaney
2002-01-04 18:56 ` Darren New
2002-01-04 19:10 ` Hyman Rosen
2002-01-04 20:08 ` Matthew Heaney
2002-01-04 20:14 ` Ted Dennison
2002-01-04 20:20 ` Hyman Rosen
2002-01-04 21:16 ` Larry Kilgallen
2002-01-04 21:33 ` Ted Dennison
2002-01-07 15:39 ` Hyman Rosen
2002-01-07 16:06 ` Ted Dennison
2002-01-07 16:50 ` Larry Kilgallen
2002-01-07 17:18 ` Hyman Rosen
2002-01-07 17:26 ` Pat Rogers
2002-01-07 18:12 ` Hyman Rosen
2002-01-07 18:40 ` FGD
2002-01-07 20:04 ` Pat Rogers
2002-01-05 0:08 ` Nick Roberts
2002-01-05 10:57 ` Simon Wright
2002-01-08 23:27 ` Nick Roberts
2002-01-09 9:58 ` Stuart Palin
2002-01-09 11:11 ` Nick Roberts
2002-01-10 20:32 ` Robert A Duff
2002-01-11 9:45 ` Stuart Palin
2002-01-11 13:32 ` Robert A Duff
2002-01-11 20:26 ` Literate Programming [was: A case where ...] Nick Roberts
2002-01-12 16:37 ` Georg Bauhaus
2002-01-13 14:46 ` Nick Roberts
2002-01-14 14:17 ` Eric Merritt
2002-01-14 23:20 ` Nick Roberts
2002-01-15 18:54 ` Eric Merritt
2002-01-14 14:34 ` Stephen Leake [this message]
2002-01-14 13:14 ` A case where Ada defaults to unsafe? Stuart Palin
2002-01-14 14:38 ` Preben Randhol
2002-01-16 6:00 ` Simon Wright
2002-01-17 3:04 ` David Starner
2002-01-17 15:08 ` Georg Bauhaus
2002-01-17 20:25 ` Simon Wright
2002-01-17 9:56 ` Stuart Palin
[not found] ` <3 <3C469FE6.B2C67ED6@baesystems.com>
2002-01-17 20:32 ` Simon Wright
2002-01-14 14:35 ` Preben Randhol
2002-01-14 16:36 ` Robert A Duff
2002-01-12 12:27 ` Simon Wright
2002-01-05 0:32 ` Robert Dewar
2002-01-14 16:09 ` Matthieu Moy
2002-01-20 8:59 ` Hyman Rosen
2002-01-20 19:13 ` Jim Rogers
2002-01-20 21:19 ` Ray Blaak
2002-01-03 22:07 ` Ted Dennison
2002-01-04 17:12 ` Preben Randhol
2002-01-04 17:21 ` Jean-Marc Bourguet
2002-01-04 18:54 ` Ted Dennison
2002-01-04 3:17 ` Larry Kilgallen
2002-01-04 8:27 ` Thierry Lelegard
2002-01-04 8:39 ` tmoran
2002-01-04 9:03 ` Thierry Lelegard
2002-01-04 14:43 ` Wes Groleau
2002-01-04 15:45 ` Ted Dennison
2002-01-04 16:37 ` Wes Groleau
2002-01-04 16:56 ` Ted Dennison
2002-01-04 11:51 ` Larry Kilgallen
2002-01-04 12:41 ` M. A. Alves
2002-01-04 15:42 ` Ted Dennison
2002-01-04 17:16 ` Hyman Rosen
2002-01-04 19:12 ` Ted Dennison
2002-01-04 23:36 ` Matthew Woodcraft
2002-01-05 15:00 ` Steve Doiel
2002-01-10 20:49 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox