The program is already distributed freely on the web under GPL or
something like that, so I would meet my obligations by distributing
the original source code with proper acknowledgments. But I'm wondering
whether it is in any way obligatory or desirable to try to preserve the
original program as much as possible when converting it to CWEB. I'm also
wondering to what extent, if I do make changes in it, I ought to exhibit
in the literate document both the original and what I changed it to,
just to be honest about what I did and what I inherited.
--
Ignorantly,
Allan Adler <a...@zurich.csail.mit.edu>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.
>
>Just for practice, I'm trying to convert someone else's old K&R C program
>to CWEB. On the other hand, the C compiler I use is gcc on RedHat 7.1. It
>is extremely tempting to make changes to conform to the ANSI standard
>and in some cases it is necessary, since some functions defined in
>the program already exist in C libraries and have different behavior.
>To some extent that can be handled with change files. I also can't help
>noticing certain improvements that it would be easy to make in the
>program. It is also hard to resist adding them, perhaps subject
>to selection by a command line option.
>
>The program is already distributed freely on the web under GPL or
>something like that, so I would meet my obligations by distributing
>the original source code with proper acknowledgments. But I'm wondering
>whether it is in any way obligatory or desirable to try to preserve the
>original program as much as possible when converting it to CWEB. I'm also
>wondering to what extent, if I do make changes in it, I ought to exhibit
>in the literate document both the original and what I changed it to,
>just to be honest about what I did and what I inherited.
A simple #if 0...#endif around the original C code will preserve it,
#ifdef ORIGINAL...#endif and #ifdef IMPROVED...#endif will distinguish
it, or web the original, then add the improvements in a separate
change file using @x @y @z: that way, you can use the web alone to get
the original code/doc, or with the change file to get the improved
code/doc. ISTM which way(s) you use really depends on how you want to
document each improvement to the original code.
--
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
Brian....@CSi.com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
fake address use address above to reply
Congratulations; you've discovered a major benefit of literate programming :-)
--
Norman Ramsey
http://www.eecs.harvard.edu/~nr
>Congratulations;you've discovered a major benefit of literate programming :-)
Indeed. I posted something recently on another newsgroup plugging literate
programming as a way of learning to read source code. It gives one the
patience to read.