Archive-Date: Sat, 01 Aug 1992 06:08:56 CDT From: Timothy Murphy Reply-To: LITPROG@SHSU.edu Subject: Re: LitProg: A "Tempest in a Teapot"? To: LITPROG@SHSU.edu Date: Sat, 1 Aug 92 12:07:03 BST Sender: tim@maths.tcd.ie Message-ID: <9208011207.aa03598@salmon.maths.tcd.ie> Psst. DEK isn't listening, is he? I wonder has he got a mole in this group? The truth is, only pointy-heads and weirdos use plain TeX nowadays. Everybody else in the world, including Dan Quayle, is using LaTeX. That's the main reason, IMHO, for the relative failure of WEB (as opposed to TeX itself). Life is too short to study webmac, when one could be listening to Enya. Timothy Murphy e-mail: tim@maths.tcd.ie tel: +353-1-2842366 (home/office) +353-1-7021507 (university) fax: +353-1-2842295 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland ================================================================================ Archive-Date: Sat, 01 Aug 1992 07:05:02 CDT From: kardaras@ecn.purdue.edu (George S Kardaras) Reply-To: LITPROG@SHSU.edu Message-ID: <9208011203.AA08984@en.ecn.purdue.edu> Subject: Re: LitProg: A "Tempest in a Teapot"? To: LITPROG@SHSU.edu Date: Sat, 1 Aug 92 7:03:14 EST Sorry for doing it this way, but I'm going to leave for three weeks and I tried to sign off but with no luck. I would be obliged if the owners removed me from the list. Thanks. George Kardaras ================================================================================ Archive-Date: Sat, 01 Aug 1992 10:32:52 CDT Date: Sat, 1 Aug 92 17:39:25 +0200 From: Marcus Speh Reply-To: LITPROG@SHSU.edu To: LITPROG@SHSU.edu Subject: Time for Crimethink. Reply to Murphy's Guess. References: <9208011207.aa03598@salmon.maths.tcd.ie> Tim, you whispered: Tim> Psst. Tim> DEK isn't listening, is he? whim> I wonder has he got a mole in this group? Is there some congenial relationship between DEK and Big Brother? Tim> The truth is, Tim> only pointy-heads and weirdos use plain TeX nowadays. Tim> Everybody else in the world, including Dan Quayle, Tim> is using LaTeX. I agree with that. Though, I wonder..who's that potatoe Dan Quayle - did he write a Macro that I should know? I do not agree with Murphy's Guess: Tim> That's the main reason, IMHO, Tim> for the relative failure of WEB Tim> (as opposed to TeX itself). I *am* using LaTeX with (F)WEB. Never really learnt anything else but LaTeX. I don't consider WEB a failure just because it isn't a discipline by its own in Barcelona, yet. Success relative to TeX's: ask one of the older chaps what they thought, say, 7 years ago, seeing the TeX source to what should become their paper... in 1990, still, I had to fight hard to convince anyone to use LaTeX instead of Plain TeX (plus some self-made clumsy macros to set the title page)- no, not on Galapagos, but in a major European [aha!] theoretical physics institute with lots of smarties around. I do not think anyone could have foreseen the enormous success of TeX in the scientific world [the only mouse hole I know] - Why give up hope for Literal Programming yet? It is not greater computational complexity which makes people shrink back from LitProg. Unlike LitProg, TeX did not really have any serious competitor, though, I think. As far as I can see, including the previous postings in this group, most people do not restrict themselves to literal programming. Of course this is Crimethink already. The success of TeX seems to be rooted in the fact that it was free from beginning and grew into an institution pretty soon - inheriting some seriousness from DEK. Question to anyone of the more veteran LP's: how "institutionalized" is Literate Programming today? o Are there meetings, special journals? o Servers with special software? o Experiences with trying to *publish* a literate program "as-is"? o If not: what would you like to see? [I myself do not read any CS related journal, being a truly illiterate literate programmer.] What can we do? For now, we can only increase the popularity of Literate Programming by creating a stimulating environment on this list. And sharing code perhaps. In addition to what has already been down-loaded. [\stimulate{LITPROG} is another freely available environment.] I case there is nobody at your place to ask: I invite anyone who has in mind to start using FWEB, or has started it not too long time ago to ask, or discuss it with me. I was happy enough to have a knowledgeable person here when I started, and that helped a lot. --marcus Disclaimer: - I do not know anything about Galapagos, really. Is there a deadline for ceasing to send the typical Summertime postings? I would definitely respect it--my postings show the tendency to grow beyond a certain length on these hot weekends in town... =================================================================== Marcus Speh INTERnet II. Institut f. Theor. Physik BITnet Luruper Chaussee 149 DECnet <13313::SPEH> 2000 Hamburg 50/Germany Tel.(040)8998-2260 FAX:(040)8998-2267 ================================================================================ Archive-Date: Sat, 01 Aug 1992 11:00:31 CDT Date: Sat, 1 Aug 1992 17:33 MET From: CGL@RUGR86.RUG.NL Reply-To: LITPROG@SHSU.edu Subject: Re: LitProg: A "Tempest in a Teapot"? To: LITPROG@SHSU.edu Message-ID: <01GN2Q8CQG6O8WWDP2@RUGR86.RUG.NL> I started with LaTeX and are now using TeX to my staisfaction. Because it is more orthogonal, more compact and stable. Of course I don't refrain from using any TeX especially when publishing houses support the author, by providing guidelines et cetera. TUG itself allows users/ authors to submit LaTeX or TeX copy, so not everybody is using LaTeX. With respect to literate programming the idea to write for humans is not new, to supply tools which more or less force a programmer to document what he is doing is something. But as far as I see it, and at the moment not much experience with WeB, is the relational structure as opposed to the hierarchical structure, the real break through. History in database programs demonstrated the usefulness of that approach. I hope to contribute more in future to this list or to the literature of literate programming by `programming pearls.' In the mean time I keep my ears open, ---Kees van der Laan--- ================================================================================ Archive-Date: Thu, 06 Aug 1992 08:14:09 CDT Date: Wed, 05 Aug 1992 16:59:55 CDT From: Thorsten Ohl Reply-To: LitProg@SHSU.edu Subject: FWEB on a HP9000 ?? References: <9208052144.AA11533@crunch> >>>>> On Wed, 5 Aug 92 15:28:32 MDT, Fiegel Robert AM-T 678-3756 said: bob> Has anyone installed FWEB v1.23 on an HP machine? Yes. bob> I'm not a C programmer so tried the ANSI C make, but ran into bob> errors. The flags/options on the cc line are evidently not what bob> HP C expects. Either get GCC (the GNU C Compiler), or use (if you have it) the unbundled HP ANSI C Compiler, which is invoked with `cc -Aa' (as cc(1) explains in detail :-). Then the make should proceed without any problems. ////// Thorsten Ohl, DESY (-T-), Notkestr. 85, W-2000 Hamburg 52, F.R.G. ///////// net: ohl@crunch.ikp.physik.th-darmstadt.de, ohl@gnu.ai.mit.edu //////////////////////// voice: +49-40-8998-3699, fax: +49-40-8998-3282 ================================================================================ Archive-Date: Thu, 06 Aug 1992 08:14:09 CDT Date: Thu, 6 Aug 92 09:11 EDT From: "Jack W. Sharer 814 863-4116" Reply-To: LITPROG@SHSU.edu Subject: Ada WEBs To: LITPROG@SHSU.edu I've collected the following information on Ada WEB versions over the past several years. I would recommend Ramsey's Spider WEB; and, if your using DOS, Neuwirth's adaptation. Jack W. Sharer Penn State University j0s@psuvm.psu.edu ===================================================================== -------- SIMTEL20 Ada Software Repository Prologue ------------ -- -- Unit name : AWEB release -- Version : 1.0 (based on Tangle 2.8) -- Author : U. Schweigert -- : Unknown, somewhere in Germany... -- : released in the states by Karl A. Nyberg, -- : Grebyn Corporation, PO 497, Vienna, VA -- : 22183-0497, 703-281-2194 -- DDN Address : karl@grebyn.com -- Copyright : public domain -- Date created : 7/14/89 - Bastille Day -- Release date : 5/31/89 -- Last update : 5/31/89 -- Machine/System Compiled/Run on : VAX/ULTRIX VADS 5.5c (kan) -- --------------------------------------------------------------- -- -- Keywords : documentation, formatting, development -- -- Abstract : -- -- This program converts an .AWEB file to an Ada file. It was written -- ---originally for conversion to PASCAL---by D. E. Knuth in September, -- 1981; a somewhat similar SAIL program had been developed in March, -- 1979. Since this program describes itself, a bootstrapping process -- involving hand-translation had to be used to get started. The -- conversion to Ada has been done by U. Schweigert in May 1988. -- -- The program consists of three parts : Ada code for atangle, aweave, -- and supporting files for Tex. Bootstrap versions of the .aweb files -- are included within the supporting files .src file. -- -- Thus there are three files: atangle.src, aweave.src, and texfiles.src. -- -- All files have maintained the original names as distributed by the -- original author. -- -- Additional support files include local modifications by PCS GMBH for -- their system by Horst Kern. -- ------------------ Revision history --------------------------- -- -- DATE VERSION AUTHOR HISTORY -- 7/14/89 1.0 U. Schweigert Initial submission to ASR -- by Karl A. Nyberg ... -------------------END-PROLOGUE-------------------------------- ===================================================================== Norman Ramsey, Department of Computer Science, Princeton University, 35 Olden Street, Princeton, New Jersey 08544, Internet: nr@princeton.edu, Telephone: (609)-258-55388 has developed Spider WEB. It appears to me to be a meta-WEB system. Using awk grammar files, he has generated Unix WEB's for Ada AWK, a string processing language Kernighan and Ritchie C C++, courtesy of Ed Kademan Edsger Dijkstra's language of guarded commands (flaky) The Larch Shared Language, used for specifying equational theories. Ada, extended with formal comments for verification The language of the Cornell Synthesizer Generator Spidery WEB is available by anonymous ftp from princeton.edu:~ftp/pub. See Ramsey. "Weaving A Language-Independent WEB," _CACM_, _32_, 9, September 1989. ===================================================================== Sylvester Fernandez, ngcr@planet8.planet8.sp.unisys.com [sic], has made corrections to the Ada Spider grammar. His corrections are supplied with Ramsey's standard distribution from princeton.edu. ===================================================================== Erich Neuwirth, a4422dab@awiuni11.bitnet, has adapted Ramsey's Unix code to MSDOS with the Microsoft "C" compiler. I found his work on host rusinfo.rus.uni-stuttgart.de, [129.69.1.12], in directory soft/tex/web/spiderweb. ===================================================================== An Ada WEB from Baker and Yu (Florida State University): ----------- Plain_WEB has the original WEB system with the webmac.tex file. You have to use the webmac.tex in order to get correct results. Ada_WEB has the compilable source file for Ada_WEB. Ada_WEB_Test has all Ada_WEB system test files, *.WEB. Tex_Files has all tex files. Y.C. Wu 1988 ----------- WARNING: These programs are known to have some bugs; be careful. There is one file in this directory that does not come from FSU. APE.macros -- Ada TeX macros from Stanford University (c). By the way another good way to handle Ada text in LaTeX is to use the verbatim environment and an auxiliarly program to extract the Ada code from the LaTeX file. I did this using a special macro (which ordinarily does nothing but expand to \begin{verbatim}) to include the name of the file I wanted the code to go onto. The typesetting quality is poor, but avoids problems with indentation since the font is fixed-width; it also insures agreement between Ada code and text in paper. --Ted Baker, 30 May 1989. Florida State University Tallahassee, FL 32306-4019 tpb@sei.cmu.edu (may be temporary) ================================================================================ Archive-Date: Thu, 06 Aug 1992 10:36:27 CDT Date: Thu, 6 Aug 92 09:34:40 -0600 From: jongill@lilac.bldrdoc.gov (Jonathan M. Gilligan) Reply-To: LITPROG@SHSU.edu Subject: Knuth and CWEB (was: Literate Programming is not necessarily monolithic) To: LITPROG@SHSU.edu Message-ID: <9208061534.AA24541@lilac.csd.bldrdoc.gov> George D Greenwade writes: I am still admitting a HUGE ignorance of virtually all high-level languages, but I think it's worth noting that Knuth's name is now attached to Silvio Levy's CWEB (now Levy-Knuth CWEB). It is relatively clear that Knuth not only has suggested that better interfaces should be built -- as I understand it, he has already made enhancements and extensions to other conceptual applications of WEB in other non-Pascal languages. I include an interesting article that Timothy Murphy of Trinity College in Dublin posted to the NTS mailing list a couple of months ago. ---Jon %%%%%%%%%%%%%%%%%%%%%%%%%% Begin included article %%%%%%%%%%%%%%%%%%%%%%%%% Return-Path: From: Timothy Murphy Subject: Re: Eradicating artificial limitations in NTS To: "Jonathan M. Gilligan" In-Reply-To: Jonathan M. Gilligan's message of Wed, 3 Jun 92 12:19:34 -0600 Date: Thu, 4 Jun 92 2:40:03 BST Sender: tim@maths.tcd.ie > First, I don't see the advantage of C over Pascal. Pascal supports > dynamic allocation, it has an ISO standard, and it is strongly typed, > which C is not. I think C is just great --- no language flame wars, > please --- but I don't believe that there is one best language in > which to write NTS. As well, I have spent enough time trying to port > abominable C code from UNIX to DOS to have been disabused forever of > the idea that C is automatically or easily portable. WEB could > presumably be extended rather simply to support dynamic allocation. I'm pretty sure that if Knuth were starting again he would use C rather than Pascal. We had the pleasure and honour of a long visit by him earlier this year, and he spent a great deal of his time hacking cweb. (This seemed the only part of TeX he was concerned with, at that time anyway.) He spoke strongly in favour of Literate Programming in C. He was absurdly modest about TeX, and complained that as he went round the world he found mathematicians everywhere crouched over their terminals typing in TeX when they should be in the library! When asked why he hadn't tried to make money out of TeX, he replied that he _had_ patented 1 algorithm (I wonder which one?) He was very interested and supportive of attempts to design an Irish font, and asked to see examples of old Irish printing. His own lectures, incidentally, were all handwritten in several colours on transparencies. Timothy Murphy e-mail: tim@maths.tcd.ie tel: +353-1-2842366 (home/office) +353-1-7021507 (university) fax: +353-1-2842295 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland ================================================================================ Archive-Date: Fri, 07 Aug 1992 20:48:42 CDT Date: Fri, 7 Aug 92 21:12:59 -0400 From: mfy@sli.com (Mike Yoder) Reply-To: LitProg@SHSU.edu Subject: LP -- pros & contras To: LitProg@SHSU.edu Message-ID: <9208080112.AA03083@ravel.sli.com> Daniel Kustrin wrote: >Has anyone had good/bad experiences with large programs in CWEB and if so are >there things that we (novices) should know. There is a problem I encountered with LP which can be very serious in large programs and fairly minor in small ones. It can be described as the problem of incrementality; it can either be fixed in your LP tool or, possibly, in your make files and source control. Suppose you have a large program written using LP techniques, and now say that you want to edit its documentation WITHOUT changing anything in the code. You do so, and now your generated Ada or C or whatever looks out of date with respect to the LP source. So, the next time you do a "make" command, the LP program will run, generating a new program (which happens to be the same as the old one); its binaries now look out of date, so the compiler is invoked to recompile the source; any modules that depend on this one may also end up getting recompiled, and finally your linker will link the whole mess. The result can be a very long and time-consuming null operation. I solved this problem by having my LP tool compare all generated sources to their old versions (when such existed) and to simply delete the new source if it was the same as the old. This makes all the dates look the way you want, so a "make" will rebuild just what it would rebuild if you hadn't used LP techniques. Using this technique makes LP be an improvement over the technique of using special comments, because in the latter method make will still recompile your program if you edit only parts of the program that are inside comments. I think that this ability is essential to an LP system used with large programs (even with medium-sized programs, doing without it is painful). And yes, this does mean that I think the special comments method is inadequate for doing LP with large programs. Michael F. Yoder [mfy%sli@uunet.uu.net] ================================================================================ Archive-Date: Mon, 10 Aug 1992 00:41:54 CDT Date: Mon, 10 Aug 1992 00:40:29 -0500 From: Cameron Smith Reply-To: LitProg@SHSU.edu Subject: K&R CWEB sample requires current software To: LitProg@SHSU.edu Message-ID: <199208100540.AA03546@procyon.math.uiuc.edu> This posting explains some problems a couple of users have had with my sample CWEB program, and how to work around at least one of them. Two alert users of my CWEB sample program (based on the calculator program from Chapter 4 of the K&R C book) have reported problems TeX'ing the cweave output from "calc.w". Both of them reported the following behavior: * TeX prompts for input from the keyboard when it ought to be reading from the file "mod.lst" As far as I can tell from the feedback I've received, this happens *only* to people using pre-3.0 versions of TeX. Apparently the "\par" token that is supposed to be generated at end-of-file (which is what the code in "calc.w" uses to detect that it has read all of "mod.lst") isn't generated by older versions of TeX, at least not in this circumstance. Perhaps someone more familiar than I am with the recent evolution of TeX may recognize this as a bug in file-reading that was fixed in release 3.0 or later? At any rate, since the versions of TeX for which this failure has been reported are three or more years old now, I don't regard this as a critical defect, but I do advise anyone who is using so old a version to get an update ASAP (whether or not s/he wishes to try out my CWEB sample program). Meanwhile, for those for whom an upgrade is not an immediate possibility (because the TeX maintainers have other tasks in their queues), you can patch things to work by adding the line echo "\par" >> mod.lst to the Makefile in the actions for the "mod.lst" target (after the line that writes the module names to the file); this explicit \par token signals the loop that reads the module names from "mod.lst" that the end of the list has arrived. (For those not familiar with the "make" utility, please note that this line *must* begin with a tab character to be recognized properly; spaces will NOT do!) In addition, one of the respondents reported problems that turned out to be related to the use of an antique version (2.0) of CWEB. The macros in "cwebmac.tex" had changed sufficiently to be slightly incompatible with the (admittedly rather grungy) code in "calc.w". This can, of course, easily be fixed by obtaining the current version of CWEB (via FTP from labrea.stanford.edu or niord.shsu.edu, or via email from FILESERV@niord.shsu.edu). The CWEB utilities (ctangle and cweave) are easy to compile; they, and the "cwebmac.tex" file, are all you need in order to use CWEB, so this (unlike TeX) is something that shouldn't be too hard for individual users to set up without requiring the aid of system gurus (although of course if there are many CWEBsters at one site it's better to have a single shared copy of each tool than to have each user comiler his/her own). Finally, the same person also reported problems when using a Sun C++ compiler (the only ANSI-compatible C compiler available to him) to compile the output of ctangle. It seems that this compiler does not respect the "static" declaration; the effect in the calculator program is that hash is made of the routines that manipulate the operand stack. (Yes, folks, this poor soul had problems with TeX *and* CWEB *and* his compiler; it's amazing he got anything to work at all!) In summary, to make everything in the sample program work "as is", you need: * a reasonably current (at least 3.0) version of TeX, * a reasonably current version of CWEB, and * an ANSI-compatible, reasonably correct C compiler. And if you have these, it *does* work -- at least, as far as I've been able to tell from the feedback I've received so far. Just thought I'd point this out since these questions have popped up in the last couple of days; I'll add specific warnings to the README file if I release a new version. Thanks to all who have sent feedback! To others who have tried it, remember: Even if you have no bugs to report, or comments or suggestions for improvement, I'd still be interested in knowing what systems it has been successfully compiled with (and so, I'm sure, would other potential users, who would be encouraged to be able to see in the README file that it is indeed possible to get the program to work on their configurations!). Cheers-- --Cameron Smith ================================================================================ Archive-Date: Mon, 10 Aug 1992 05:39:06 CDT Date: Tue, 4 Aug 1992 14:10:01 +22313801 (EDT) From: Joey Gibson Reply-To: LitProg@SHSU.edu Subject: Help with function pointers To: LitProg@SHSU.edu Message-ID: In a web i created, I had the following declaration: void far (*reset)(); to indicate a function pointer. When I tangle it, it works fine. COmpiles without error. When I weave it, however, weave thinks it is a function named far and typesets it like this: void far(*reset)(); I know the space between far and the '(' is not a lot, but it does help to explain the meaning of the code. If anyone knows how to fix this, let me know. BTW, I am using FWeb, v1.23 for the PC. Joey Gibson ===> Please address all E-mail to ===> The views expressed here are not necessarily those of EMA. ================================================================================ Archive-Date: Mon, 10 Aug 1992 07:14:44 CDT Date: Mon, 10 Aug 92 14:11:46 MEZ From: Hans-Hermann Bode Reply-To: LitProg@SHSU.edu Subject: Re: Help with function pointers To: LitProg@SHSU.edu Joey Gibson wrote: >In a web i created, I had the following declaration: > >void far (*reset)(); > >to indicate a function pointer. When I tangle it, it works fine. >COmpiles without error. When I weave it, however, weave thinks >it is a function named far and typesets it like this: > >void far(*reset)(); Say @f far int somewhere in your source. Weave does not by default recognize |far| as a reserved word (this is definitely true for CWEAVE, but I think it's true for FWEAVE, too). Hans-Hermann Bode Arbeitsgruppe Systemforschung, Universit\"at Osnabr\"uck Tel.: (49)-541-9692545 e-mail: HHBODE@DOSUNI1.BITNET ================================================================================ Archive-Date: Mon, 10 Aug 1992 10:11:17 CDT Date: Mon, 10 Aug 1992 10:59:48 -0400 From: sanjeev@theory.cs.psu.edu (Sanjeev Y. Dharap) Reply-To: LitProg@SHSU.edu Message-ID: <9208101459.AA21193@omega.theory.cs.psu.edu> To: LitProg@SHSU.edu Subject: Help with function pointers Recently you wrote: Joey> In a web i created, I had the following declaration: Joey> void far (*reset)(); Joey> to indicate a function pointer. When I tangle it, it works fine. Joey> COmpiles without error. When I weave it, however, weave thinks Joey> it is a function named far and typesets it like this: Joey> void far(*reset)(); Try making the foll. declaration @f far int hope that helps, sanjeev ---- sanjeev dharap | penn state university | sanjeev@cs.psu.edu 333 whitmore lab | university park, pa 16802 | ================================================================================ Archive-Date: Mon, 10 Aug 1992 15:02:45 CDT Date: Mon, 10 Aug 1992 15:16:12 +22313801 (EDT From: Joey Gibson Reply-To: LitProg@SHSU.edu Subject: FWeb on the Mac? To: LitProg Mail-List Message-ID: Has anyone tried to compile FWeb v1.23 on a Macintosh? I was considering trying to make it an MPW tool, but if someone else has already done this I would like to know. Joey Gibson => "In the country of the blind, the one-eyed man is king." H.G. Wells <= ===> The views expressed here are not necessarily those of EMA. <== ================================================================================ Archive-Date: Tue, 11 Aug 1992 12:14:54 CDT Date: Tue, 11 Aug 1992 13:11:32 -0400 From: sanjeev@theory.cs.psu.edu (Sanjeev Y. Dharap) Reply-To: LitProg@SHSU.edu Message-ID: <9208111711.AA01887@omega.theory.cs.psu.edu> To: LitProg@SHSU.edu Subject: Help with change file. Is this a bug? Hi, I am using CWEB Version 2.4. I wanted to make the following changes to common.w 1. Print an error message if .c file already exists. (So I dont overwrite it with what should have been a .h file). 2. If the change file name is 'null' or '/dev/null' make the change-file name /dev/null. (so I can give a command 'ctangle foo-h.w null foo.h) 3. Increase buf_size to 256. I copied common.w to common.w.modified, made the changes I wanted and created the change-file using a unified diff. (I have attached the perl script to do that at the bottom). The change file is also attached. Here's what happened. > ctangle common common-syd.ch This is CTANGLE (Version 2.4) *1*5*7 ! Hmm... 8 of the preceding lines failed to match. (l. 65 of change file) @y *27*46*54*63*67 Writing the output file (common.c):.....500.. Done. (Pardon me, but I think I spotted something wrong.) I noticed that the error occurs because there is a partial match between lines 1019 and 1035 of common.w (namely) 1019 if (s-*argv > max_file_name_length-5) 1035 if (s-*argv > max_file_name_length-4) If I make a small change near 1019 (like adding a space) then that line gets included in the change file and ctangle does not give any errors. I think there is sufficient context in the change file to make the chunk in question unique. Am I doing anything wrong? thanx sanjeev. ---- common-syd.ch ------- @x % permission notice identical to this one. \def\v{\char'174} % vertical (|) in typewriter font \def\title{Common code for CTANGLE and CWEAVE (Version 2.4)} \def\topofcontents{\null\vfill \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and {\ttitlefont CWEAVE}} \vskip 15pt \centerline{(Version 2.4)} \vfill} \def\botofcontents{\vfill \noindent Copyright \copyright\ 1987,\thinspace1990 Silvio Levy and Donald E. Knuth @y % permission notice identical to this one. \def\v{\char'174} % vertical (|) in typewriter font \def\title{Common code for CTANGLE and CWEAVE (Version 2.41)} \def\topofcontents{\null\vfill \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and {\ttitlefont CWEAVE}} \vskip 15pt \centerline{(Version 2.41)} \vfill} \def\botofcontents{\vfill \noindent Copyright \copyright\ 1987,\thinspace1990 Silvio Levy and Donald E. Knuth @z @x Since |buf_size| is strictly less than |long_buf_size|, some of \.{WEB}'s routines use the fact that it is safe to refer to |*(limit+2)| without overstepping the bounds of the array. @d buf_size 100 /* for \.{WEAVE} and \.{TANGLE} */ @d long_buf_size 500 /* for \.{WEAVE} */ @= char buffer[long_buf_size]; /* where each line of input goes */ char *buffer_end=buffer+buf_size-2; /* end of |buffer| */ @y Since |buf_size| is strictly less than |long_buf_size|, some of \.{WEB}'s routines use the fact that it is safe to refer to |*(limit+2)| without overstepping the bounds of the array. @d buf_size 256 /* for \.{WEAVE} and \.{TANGLE} */ @d long_buf_size 656 /* for \.{WEAVE} */ @= char buffer[long_buf_size]; /* where each line of input goes */ char *buffer_end=buffer+buf_size-2; /* end of |buffer| */ @z @x { if (s-*argv > max_file_name_length-4) @; if (dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); else strcpy(change_file_name,*argv); found_change=1; } @y { if (s-*argv > max_file_name_length-4) @; if (dot_pos==NULL) if (strcmp(change_file_name, "null")) strcpy(change_file_name, "/dev/null"); else sprintf(change_file_name,"%s.ch",*argv); else strcpy(change_file_name,*argv); found_change=1; } @z @x @ @= scan_args(); if (program==tangle) { if ((C_file=fopen(C_file_name,"w"))==NULL) fatal("! Cannot open output file ", C_file_name); @.Cannot open output file@> } @y @ @= scan_args(); if (program==tangle) { if ( access(C_file_name, 0) == 0) { fprintf(stderr, "File %s exists!\n", C_file_name); exit(1); } if ((C_file=fopen(C_file_name,"w"))==NULL) fatal("! Cannot open output file ", C_file_name); @.Cannot open output file@> } @z ------------------------ Perl script to generate change-files --------- makechange------- #!/usr/bin/perl # Make .ch file from the diff of two files. # # usage : makech orig-file changed-file # $me = $0; $me =~ s/^.*\///; die "usage: $me orig-file changed-file\n" unless $#ARGV == 1; open (FOO, "gdiff +unified=4 $ARGV[0] $ARGV[1] |"); ; ; ; while ($line = ){ $k = substr($line, 0, 1); $line =~ s/.//; $first .= $line, $second .= $line if ($k eq ' '); $first .= $line if ($k eq '-'); $second .= $line if ($k eq '+'); if ($k eq '@'){ print STDOUT "@x\n$first@y\n$second@z\n"; $first = ''; $second = ''; } } print STDOUT "@x\n$first@y\n$second@z\n"; --------------------------- sanjeev ---- sanjeev dharap | penn state university | sanjeev@cs.psu.edu 333 whitmore lab | university park, pa 16802 | ================================================================================ Archive-Date: Tue, 11 Aug 1992 12:23:00 CDT From: dan@minster.york.ac.uk Reply-To: LitProg@SHSU.edu Date: Tue, 11 Aug 92 18:13:57 Message-ID: To: LitProg@SHSU.edu Subject: CWEB I am having a small (suite) of problem(s) with CWEB. One of the more irritating is that it does not type set the following correctly: typedef enum { SINIT, /* task initialised */ SRUN, /* ready to run */ STERM, /* task terminated */ SACCEPT, /* waiting for corresponding entry */ ENTRYQ, /* queued for corresponding accept */ /* and so on for a few more states */ } STATE; Now we all see that STATE is a type. CWEB belives that it is a variable. Although @f would work I don't want to have more @f statements then code... Also can I stop CWEB formating my C code. I am happy with the current layout of my code, and I am not happy with the way WEB attacked it and reformated it. Not nice. Can anyone help? --Dan ================================================================================ Archive-Date: Tue, 11 Aug 1992 14:10:03 CDT Date: Tue, 11 Aug 1992 14:08:20 -0500 From: Cameron Smith Reply-To: LitProg@SHSU.edu Message-ID: <199208111908.AA00919@mira.math.uiuc.edu> To: LitProg@SHSU.edu Subject: Re: CWEB Dan (dan@minster.york.ac.uk) writes: > [complaint about CWEB not parsing a "typedef enum" correctly...] > Also can I stop CWEB formating my C code. I am happy with the current > layout of my code, and I am not happy with the way WEB attacked it and > reformated it. Not nice. This is my own main complaint with CWEB: it is at once too dumb and too clever in its formatting. The idea of being able to write little "scraps" of code in any order and poof! have ctangle magically assemble them into a coherent program is *really* *nice*, but I'm still not convinced that the convenience of this is worth putting up with the manhandling that my code suffers at the hands of cweave. After all, let's face it: until things reach the point where we can directly edit the beautifully typeset output of cweave and TeX, the major benefit of all this typographic niceness is in producing legible documentation for archival purposes and for the benefit of future programmers (including ourselves) who come in to work on our code. While we're still in the heat of creation, we look at the WEB source 10 times as often as the typeset listing. (This is my own experience; others should of course feel free to relate their own!) And that means that to get work done, we still must manually maintain a fairly sanely indented source file. To do this we each develop a layout style that makes sense to us. I for one find it MOST IRRITATING to have my code reformatted into someone else's style. When the reformatting actually introduces semantic confusion because the "clever" tool has misunderstood my code, it's downright infuriating. Perhaps this is petty, but it's so. Now, if it didn't involve actually rewriting the cweave program I'd consider fixing this, doing a little customizing to suit my taste, but I just don't have the *time* to tinker with someone else's massive and complicated monolithic program. Don't tell me that just tinkering with "prod.w" will fix this; it won't. *Far* *too* *much* of the typesetting "smarts" is hard-coded into cweave itself. For example, I wanted to change the way indenting is handled in short if/else constructs: instead of having if (a>b) x = y - 2; else t = 4; I wanted if (a>b) x = y - 2; else t = 4; Never mind whether this is better or worse; I wanted it. "OK," I said, "I'll just find the TeX macro that cweave emits after an if condition, and redefine it to make a line break and indentation." Not that hard to do by looking at the TeX file created by cweave and the macros from cwebmac.tex. Great. But the SAME TEX MACRO is used to do six other kinds of indentation (such as laying out type declarations of variables), so there's no way to change the if's without changing those too. Levy and Knuth just *knew* the "right" way to handle these things, so they "optimized" the code by collapsing two logically distinct operations into one, so I would have to re-write God knows how much of cweave to get this fixed. And of course it's not worth it, so I either grit my teeth and live with it, or I don't use CWEB. If CWEB is really going to fly, it needs to be redesigned so that a great deal of the formatting decision-making is decoupled from the compiled code. Ideally, it would be table-driven; CWEB would be distributed with a default set of formatting tables implementing the Levy/Knuth style, but there would be a fairly transparent configuration program that each user could run to generate his/her own private layout tables. Parser generator tools like lex and yacc, or tools for generating tables from precedence grammars, already exist and could perhaps be adapted to this purpose. Also, the TeX code would use separate names for each logical function, several of which could by default be equated via \let to the same action, but with the cweave output using the different names in different circumstances so you could redefine the format of "if (a>b) x=2" without also reformatting "int x,a,b". I will allow as how it's not reasonable to expect Knuth to have looked ahead and anticipated all of this when he designed the original WEB, and I know that Levy simply made the minimal set of changes to adapt WEB to C in making CWEB. I don't mean to disparage what they've done. But as Fred Brooks said in "The Mythical Man-Month": "Plan to throw one away; you will anyway." In "The Errors of TeX" Knuth confesses that he had qualms about letting the first TeX out for testing by others, because as long as he was the only user, if he found something about the language that he didn't like he could simply change the specification and rewrite the code. But he knew that he couldn't expect everyone who needed TeX to do a task that he hadn't anticipated to rewrite the program to make it work. But this is EXACTLY the situation we face with cweave. Now that we have some experience with WEB derivatives being used by many people other than their implementors, if we're still serious about this approach to Literate Programming, then we really need to think about designing a better LP tool. It must be more customizable, it must be better able to interact with make (no more re-compiling code because the comments changed!), etc. etc. I myself would LOVE to take off a year or two and work just on this, but I'm not a tenured fellow of anything and haven't been endowed or granted, so I'll have to decline. But I'd be very willing to contribute to a group effort on an as-time-permits basis. Is there a grad student out there looking for a thesis topic who'd be interested in spending a couple of years coordinating a distributed volunteer effort? Are there other LITPROG readers who'd be interested in working with a dozen or more people you've never met on a not-for-profit project? Am I simply dreaming? Meanwhile, I've promised to tone down my comments about c-no-web, so I'll just quietly mention that it NEVER rearranges line breaks, and then leave all of you to draw your own conclusions... ;-) Have a Literate Day-- --Cameron Smith cameron@symcom.math.uiuc.edu ================================================================================ Archive-Date: Tue, 11 Aug 1992 15:29:04 CDT Date: Tue, 11 Aug 1992 22:27:08 +0200 From: Richard Kooijman DNPAP Reply-To: LitProg@SHSU.edu Message-ID: <199208112027.AA05025@dutepp13.et.tudelft.nl> To: LitProg@SHSU.edu Subject: Re: CWEB I myself use NOWEB. It is simple and leaves all your code alone. You miss out on features likes @d and @f but the first is language specific and the latter not needed since NOWEB doesn't need hints on how to 'interpret' your code (it just copies it the way it is). It only understands @ to begin a chunk of documentation, <<...>>= to start or continue a named chunk of code and <<...>> to insert a chunk of code. Furthermore it comes with some utilities (that may have their equivalents in other implementations, but I don't know those enough) like noroots to display the code chunks that have no parents in the hierarchy, nountangle to tangle code but put the docu in comments. And of course there are equivalents of tangle and weave. It's simple and fast and language independent. Just my humble opinion, Richard. ================================================================================ Archive-Date: Tue, 11 Aug 1992 17:35:55 CDT Message-ID: <199208112233.AA00250@mucket.vast.unsw.edu.au> To: LitProg@SHSU.edu Subject: Re: CWEB Date: Wed, 12 Aug 92 08:33:51 +1000 From: stevea@vast.unsw.edu.au Reply-To: LitProg@SHSU.edu Hi all, Cameron sez: > This is my own main complaint with CWEB: it is at once too dumb and > too clever in its formatting... and goes on to say (after a bit of griping about cweave): > It must be more customizable, it must be better able to interact with > make (no more re-compiling code because the comments changed!), etc. > etc... I don't know exactly how customizable it is, but have you considered playing with something like Norman Ramsey's Spidery WEB? It allows you to specify the grammar and how you would like it formatted, which is a feature I like (I've already modified the way it handles keywords like "extern", and it only took me about half an hour, and thats starting from scratch). If you really wanted to rewrite the way weave treats your code, this is a good place to start, without having to rewrite the entire WEB code. cheers -steve ================================================================================ Archive-Date: Wed, 12 Aug 1992 01:25:38 CDT Date: Wed, 12 Aug 1992 01:24:20 -0500 From: Cameron Smith Reply-To: LitProg@SHSU.edu Message-ID: <199208120624.AA06297@antares.math.uiuc.edu> To: LitProg@SHSU.edu Subject: Re: CWEB Thanks for the pointers to Spider WEB and NOWEB (both of which are creations of Norman Ramsey, I believe). I (obviously) haven't tried either one; I will make an effort to do so in the near future. From the brief descrioptions it sounds like NOWEB is easier to get working in a hurry but Spider WEB is closer to my own personal idea of what an LP tool should be (i.e. I don't mind having code reformatted for typesetting as long as I can control the nature and extent of the reformatting). At any rate, I've heard of both products before but never until now had a reason to try them. Thanks again-- --Cameron ================================================================================ Archive-Date: Wed, 12 Aug 1992 08:18:16 CDT Date: 12 Aug 1992 09:14:26 -0400 (EDT) From: zuazaga@ucunix.san.uc.EDU (Humberto Ortiz-Zuazaga) Subject: Re: K&R CWEB sample To: LitProg@SHSU.EDU Reply-To: LitProg@SHSU.edu Message-ID: <9208121314.AA28919@ucunix.san.uc.edu> Cameron Smith wrote: > remember: Even if you have no bugs to report, or comments or suggestions > for improvement, I'd still be interested in knowing what systems it has > been successfully compiled with (and so, I'm sure, would other potential > users, who would be encouraged to be able to see in the README file that > it is indeed possible to get the program to work on their configurations!). K&R CWEB sample programs, and CWEB 2.4 both run on linux 0.97-patch1 (and probably other versions too), with gcc 2.2.2 for linux. As a matter of fact, this is a very nice setup for trying out literate programming. I've also got fweb and noweb (and c-no-web) running, although fweave drops core with a SIGIOT when writing the index. Actually, noweb even works under DOS if you replace the slick shell scripts with dumb batch files and use the Icon versions of nw and noxref. I'm still not happy. I want a tool that lets me write LaTeX in the documentation section _and_ pipes my code through tgrind _and_ is easy to use and clean. I think noweb comes close, I just need to see if I can convice it to print my code out better. I think syntactical highlighting is an important part of what literate programming should be. -- Humberto Ortiz-Zuazaga zuazaga@ucunix.san.uc.edu Dept. of Physiology & Biophysics University of Cincinnati ================================================================================ Archive-Date: Wed, 12 Aug 1992 09:53:53 CDT Date: Wed, 12 Aug 92 09:50:26 CDT From: bart@cs.tamu.edu (Bart Childs) Reply-To: LitProg@SHSU.edu Message-ID: <9208121450.AA22046@neuron.cs.tamu.edu> To: LitProg@shsu.edu Subject: Re: CWEB Yes, they are both creations of Norman Ramsey. I am sympathetic to your views of what LP tools shoule be (rather I am in complete agreement) but I fear making them so complex that they will be harder to use. To achieve what you want may require a significant extension of the `webmac.tex' that must be more or less standard with Spider. I think that it would be a little more direct than trying to change an existing weave, except possibly fweave. John may have put enough of that into it. It probably also helps that fwebmac.sty is a web created from fwebmac.web. I am going to go ahead and submit the note to the list. Best regards Bart ================================================================================ Archive-Date: Wed, 12 Aug 1992 17:31:00 CDT Message-ID: <9208122226.AA07480@neuron.cs.tamu.edu> Date: Wed, 12 Aug 92 17:24:01 -0500 From: bart@cs.tamu.edu Reply-To: LitProg@SHSU.edu To: litprog@shsu.edu Subject: Tailorable Literate Programming systems Cameron Smith's arguments are well stated. If you read the documentation that Krommes wrote in his FWEB (and it also does C and C++) you can see that he experienced some of the same pains that Dan and Cameron are talking about. I agree with them and have suggested many times that we need a ``tailorable'' LitPgm system. Norman Ramsey also used the argument that some languages need to keep the programmers `line breaks and indentation' in his design of NOWEB. One word of caution about `tailorable' LitPgm systems. One good CS philosopher noted (approximately) ``if you want to make a user interface unuseable, add functionality to it.'' The creation of a system to aid the ``ordinary literate programmer'' in maintaining or creating his/her own `preferred style' would be a monster. For example, in WEB/CWEB the @: format uses the \9 TeX control sequence (in FWEB it is @9). I have probably written more lines of WEB than most and have caused a large number of students to do so; none of us have ever defined the \9 to tailor anything. I apparently am a bit different from Cameron in that I rely on the weave/tex output extensively. I do that in spite of having a nice 1280/1024 Xterminal on my desk and the printer being at the other end of the building. Also, I AM CONVINCEd of the value of the nice formatting. I have no desire for a WYSIWYG system because WYSIWYG is a lie! What you see on the screen is at best a poor approximation of what even a low resolution device like a laser printer gives. (I don't even have convenient access to a 400dpi NeXT printer much less a high resolution device.) I usually study the code in the weave/tex output stage and when editing I want to see the escapes into code mode (|code_mode|). Too many programmers will not use long names with the underscore and italicized words are easily confused with variables. His `10 times as often' is overstated for me, but he still makes a good point. Although I am a tenured professor, I plan to put up with the indentation's ... until a willing graduate student comes along and is willing to do that work along with some tests that would help us understand its benefits, costs, ... Obviously, it does not infuriate me. I would use the word annoy. Incidentally, I also would not call it monolithic: weave.w, common.w, prod.w, ... Cameron gave a good example of a need for tailoring: if (a>b) x = y - 2; else t = 4; Although I also prefer his form, in textual matter it is quoted as common knowledge that the most readable information has 9 to 12 words per line. Counting each `word', delimiter, variable, and operator as a word, the first has 11 and the second has 4. It would not surprise me that a code beautifully typeset and using the `9 to 12' rule might be more comprehendable. The reason (IMHO) that we prefer these skinny presentations is that we have been trained to expect code in that fashion. I have trouble reading skinny Fortran codes, C codes with indentation based on 8-space tabs, C codes with aligned braces, and aligned right texts using monospace fonts. In the paragraph where he mentions: Levy and Knuth just *knew* the "right" way Don and Silvio are both great talents but I am sure they meant WEB and CWEB to be simply a first step at making systems available for the writing of better codes. I have not spent a lot of time studying Spider, but I thought that some of the `table-driven' part is there. It probably relys on a fairly small spidermac.tex/sty. That may be a place to start. I recall a lot of the earlier submissions being about WEB systems too big to work on PCs. Wouldn't making these `tailorable' also cause even more problems in the same line? We need to keep such users in mind, but not as the primary design criteria. I believe that OS/2 and MAC-Sys 7 are both virtual memory systems. Cameron's quotes of Brooks and Knuth are well chosen. Knuth has also said a number of times about how much he has learned from making codes available for the public to help him debug. Alas, we striving to do literate programming have lost him to volume 4 of ACP. I think that he would be pleased with these kinds of discussion and that he will leave the changes for us to design and implement. The questions Cameron asked in his last paragraph are good and the project(s) worthwhile. I believe the bigger contributions will be in the building of better user interfaces between things like RCS, imake, dbx, and non-monolithic webs. My compliments to the subscribers for some really good comments about literate programming ..., especially Cameron and Tim's note about Knuth's visit to Ireland. Bart Childs ================================================================================ Archive-Date: Wed, 12 Aug 1992 18:58:37 CDT From: Timothy Murphy Reply-To: LitProg@SHSU.edu Subject: Re: Help with change file. Is this a bug? To: LitProg@SHSU.edu Date: Thu, 13 Aug 92 0:57:05 BST Sender: tim@maths.tcd.ie Message-ID: <9208130057.aa00245@salmon.maths.tcd.ie> > I think there is sufficient context in the change file to make the > chunk in question unique. Am I doing anything wrong? I don't think WEB or CWEB look much at the context. They just try to match the first line of the change. So if your change starts with something like @ it is very likely to be mistaken for somewhere else. Timothy Murphy e-mail: tim@maths.tcd.ie tel: +353-1-2842366 (home/office) +353-1-7021507 (university) fax: +353-1-2842295 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland ================================================================================ Archive-Date: Wed, 12 Aug 1992 21:19:23 CDT Date: Tue, 11 Aug 92 16:43:20 -0400 From: ras@skanda.zko.dec.com (Bob Surtees) Reply-To: LitProg@SHSU.edu Message-ID: <9208112043.AA15330@skanda.zko.dec.com> To: LitProg@SHSU.edu Subject: CWEB formatting One of the things I like about CWEB is that cweave *does* format the code fairly consistantly so I don't have to be concerned about the different ways different people prefer to pretty their code. Perhaps there should be an execution switch and possibly some sort of template file that would let both fweave and ftangle format their output for those people who don't like the default. My problem is that I can't get people too excited about Literate Programming so when I'm done I have to use indent to pretty up the C sources so they can support it. Amazing! Bob Surtees (ras@skanda.zko.dec.com) ================================================================================ Archive-Date: Thu, 13 Aug 1992 01:00:47 CDT Date: Thu, 13 Aug 1992 07:57:42 +0200 From: Richard Kooijman DNPAP Reply-To: LitProg@SHSU.edu Message-ID: <199208130557.AA10180@dutepp6.et.tudelft.nl> To: LitProg@SHSU.edu Subject: Re: K&R CWEB sample > Actually, noweb even works under DOS if you replace the slick shell > scripts with dumb batch files and use the Icon versions of nw and > noxref. > I have a working NOWEB under DOS using some PD sh. I had to hack up the awk programs in the scripts, though. I have taken them out of the scripts and put them in separate AWK files. The PD sh was complaining that the command line was too long in several awk initiations. Not really the fault of the DOS sh but of DOS limitations. Richard. ================================================================================ Archive-Date: Thu, 13 Aug 1992 10:16:44 CDT From: dan@minster.york.ac.uk Reply-To: LitProg@SHSU.edu Date: Thu, 13 Aug 92 16:06:30 Message-ID: To: LitProg@SHSU.edu Subject: cweb history Just a small query. When was CWEB designed? I keep finding 1987 as the year when Silvio Levy rewrote the WEB system into C. Is this correct, 'cos I just found a University of York paper written by Harold Thimbleby entitled "Experiences of 'Literate Programming' using CWEB [a variant of Knuth's WEB]" which was written in 1984. This is a part of his introduction: "... After hearing Donald Knuth extol his literate programming system, WEB [Knuth, 1982, 1984], I decided to implement a Unix version of it, which came to be called cweb. ..." The paper is dated August 31, 1984. And it's reference number is: YCS.74(1984) Interestingly enough in the section 8.1 he points out that "... in its current form cweb needs a table which specifies the programming language lexemes, quoting mechanisms, and comment conventions. These features can be expressed using regular expressions... Language independence of a more limited form is often required..." He then expands on how regular expressions can be used to write a "spidery"-like system. He also looks at formatter independent system. Interesting, isn't it. --dan ================================================================================ Archive-Date: Thu, 13 Aug 1992 12:11:07 CDT Message-ID: <9208131708.AA03871@laphroaig.aoc.nrao.edu> Date: Thu, 13 Aug 92 11:08:48 MDT From: Chris Flatters Reply-To: LitProg@SHSU.edu To: LitProg@SHSU.edu Subject: Re: cweb history dan@minster.york.ac.uk writes: > When was CWEB designed? > > I keep finding 1987 as the year when Silvio Levy rewrote > the WEB system into C. Is this correct, 'cos I just found > a University of York paper written by Harold Thimbleby > entitled > "Experiences of 'Literate Programming' using CWEB [a variant of Knuth's WEB]" > which was written in 1984. > > This is a part of his introduction: > > "... After hearing Donald Knuth extol his literate programming system, > WEB [Knuth, 1982, 1984], I decided to implement a Unix version of it, > which came to be called cweb. ..." > > The paper is dated August 31, 1984. And it's reference number is: > > YCS.74(1984) There is no connection between the two CWEBs. Levy's CWEB is the CWEB that is in common use today. Thimbleby's was notable in using the standard UNIX typesetting utility, troff, rather than TeX. Chris Flatters cflatter@nrao.edu ================================================================================ Archive-Date: Thu, 13 Aug 1992 16:20:21 CDT Date: Thu, 13 Aug 92 17:03 EST From: Jeff Rummel Reply-To: LitProg@SHSU.edu Subject: Hacking at cnoweb To: LITPROG@SHSU.edu My coding work is such that c-no-web wins the bang for the buck analysis (at least at this point). I've made some changes to the file (to suit my taste), but there was one thing I wanted to do that is outside my TeXbility. I find on occasion that a page break occurs just after a line that has a { in it and I think it would look better to have the whole block together on a page (if page breaking allows). So I think I want a ăgoodbreak before the line, but is there some way to go back and insert such a beast when the { occurs after part of the line has been read? In this way TeX would see ăgoodbreak if (x) { Or could I throw a ănobreak after the line? TIA. --jeff. ================================================================================ Archive-Date: Mon, 17 Aug 1992 06:43:04 CDT From: dan@minster.york.ac.uk Reply-To: LitProg@SHSU.edu Date: Mon, 17 Aug 92 12:39:26 Message-ID: To: LitProg@SHSU.edu Subject: C and WEB - Problems Does anyone know how can I get comments to appear on a separate line in CWEB? Something like: while (foo>baz) { /* a comment */ frobox; quux; } I tried @/ and similar, but I didn't get thie right indentation. (Oh, yes... SpiderWEB C environment changes would be fine too. I tried an failed :( I did manage to convince Spider-C that bit-field colon is not a case colon, but that was very easy). Any ideas? ================================================================================ Archive-Date: Mon, 17 Aug 1992 09:04:45 CDT Date: Mon, 17 Aug 92 15:54:03 MEZ From: Hans-Hermann Bode Reply-To: LitProg@SHSU.edu Subject: Re: C and WEB - Problems To: litprog@SHSU.edu dan@minster.york.ac.uk asked: >Does anyone know how can I get comments to appear on a separate line in >CWEB? Something like: > > while (foo>baz) { > /* a comment */ > frobox; > quux; > } Redefine the \C macro \def\C#1{\5\5\quad$/\ast\,$#1$\,\ast/$} in cwebmac.tex or in the limbo section of your source file in the following way: \def\C#1{\6\quad$/\ast\,$#1$\,\ast/$} The \6 implies a forced line break instead of the optional \5 break. In the example above, the comment will be aligned with |frobox|. If you prefer the form exactly as given, insert a \4 (backspace one notch) in the definition, i.e., \def\C#1{\6\4\quad$/\ast\,$#1$\,\ast/$} Hans-Hermann Bode Arbeitsgruppe Systemforschung, Universit\"at Osnabr\"uck Tel.: (49)-541-9692545 e-mail: HHBODE@DOSUNI1.BITNET ================================================================================ Archive-Date: Mon, 17 Aug 1992 21:46:41 CDT Message-ID: <199208180243.AA03864@mucket.vast.unsw.edu.au> To: litprog@SHSU.edu CC: stevea@vast.unsw.edu.au Subject: Minor annoyance in Spidery WEB... Date: Tue, 18 Aug 92 12:43:39 +1000 From: stevea@vast.unsw.edu.au Reply-To: LitProg@SHSU.edu Hi all, I've come across a minor annoyance in the Spidery ceeweave program, and I was wondering if anyone out there would know a quick solution. Its really a TeX problem, but I thought I'd try here before trying comp.text.tex. Anyhow, in Spidery ceeweave, if you have two consecutive modules which are greater than one page in length, it causes a page break between the two (it tries to start modules which won't fit on the remainder of the page on a new page). Now, when it hits a module, it redefines the headline using the \N command: \N107. 3Create Centre Mask. Here 107 is the module number, 3 is the relative depth of the module nesting, and "Create Centre Mask" is the module name. The command \N looks like: \outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck \message{*\modno} % progress report \edef\next{\write\cont{\thetocskip \Z{\theopen\relax \themodtitle}{\modno}{\noexpand\the\pageno}}}\next % to contents file \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces \edef\rhead{{\ignorespaces\lowercase\themodtitle}} % define running } Now, the problem occurs because the new headline is defined prior to the current page being shipped out. As a result, the page before the page on which the module begins, has that module name in the header. Does anyone know how I might cause the page to be shipped out if it is going to be, prior to redefining the header? Thanks... cheers -steve ================================================================================ Archive-Date: Tue, 18 Aug 1992 10:08:43 CDT Date: Tue, 18 Aug 92 11:06:42 EDT From: Lee Wittenberg Reply-To: LitProg@SHSU.edu To: LitProg@shsu.edu Subject: Re: Minor annoyance in Spidery WEB... Message-ID: I found the same problem with headlines in Spidery WEB and worked out an imperfect (but better than what exists) fix to webkernel.tex. Unfortunately, all my Spidery stuff is still packed up (I'm in the process of moving). If anyone is interested in my fix when I get it unpacked (shouldn't be more than a week), you can write me direct at leew@pilot.njin.net (permanent account) or leew@cs.utexas.edu (current account while on sabbatical) Either one will work. -- Lee ================================================================================ Archive-Date: Fri, 21 Aug 1992 06:30:21 CDT Date: Fri, 21 Aug 92 13:32:16 +0200 From: jmu@ccr.jussieu.fr (Johannes MULLER p73413) Reply-To: LitProg@SHSU.edu Message-ID: <9208211132.AA15502@ccr-p6.ccr.jussieu.fr> To: LITPROG@shsu.edu Subject: FWEB Problem I tried to tangle and compile the example CWEB program given by Cameron Smith with my newly installed FWEB-System. I had to modify some notations and nearly all worked fine. Only in file "getop.w(eb) the command @o to open the file "getop.h" failed. Look the example below (which I have stripped as far as possible). What FWEB made is a bit strange: it added some non-ASCII characters to the filename "getop.h". All other examples succeeded with the same command structure. @z -----test.web----- cf.: %%% Save file as: getop.w Source: FILESERV@SHSU.BITNET %%% This is a file from a sample of the use of CWEB provided by %%% Cameron Smith @x -------------- @c @* Introduction. Here is the only unnamed code module in this file. @A @@; @ @= @; @ Export is done here: @a @o getop.h @@; @ @* The function |getop()|. @= int getop(char s[]) @ @= #define NUMBER '0' @* Index. ------------------cut here------------------------ What ftangle made: > ftangle test This is ScRaMbLeD FTANGLE [SunOS/UNIX version 1.23a (April 13, 1992)]. Reading test.web... *1 *4 *6 Writing the output file(s): (test.c)(getop.hQws) Done. CPU = 0.3 sec.; REAL = 0.8 sec. CPU/REAL = 45.0%. [FTANGLE: No errors were found.] ------------------------------------------------------ Note the strange extension to getop.hxxxxx! Who has an idea about this effect? Thank you very much Johannes Mueller Inst. des Neurosciences F-75005 Paris ================================================================================ Archive-Date: Fri, 21 Aug 1992 09:01:13 CDT Date: Fri, 21 Aug 92 15:57:53 MEZ From: Hans-Hermann Bode Reply-To: LitProg@SHSU.edu Subject: CWEB-p -- a portable WEB for ANSI C and C++ To: litprog@SHSU.edu Due to Klaus Guntermann CWEBPC, a CWEB adaptation supporting ANSI-C and C++ typesetting features (announced on this list a few weeks ago), evolved from a somewhat portable PC application to a really portable one. After some extensive exchange of diff files we got a system that now without changes is compilable at least with the following compilers: - Turbo C++, Version 1.01, under PC-/MS-DOS, - c89 under HP-UX 8.0 on a HP 9000/400, - c89 under AIX 3.2 on a IBM RS/6000, - gcc, Version 1.40, with option -ansi, for a MC680x0 processor. On the face of it two things changed: first, I renamed the package in CWEB-p (``p'' as ``portable''); second, with respect to the archive formats common on the various systems, in addition to the usual zip file I compiled a tar.Z archive (both with identical contents, but with appropriate line feeds, respectively). You can find cweb-p.zip und cweb-p.tar.Z on dione.rz.uni-osnabrueck.de (in pub/msdos/tex/web and pub/unix/TeX/WEB, resp.) and on ftp.uni-stuttgart.de (in soft/tex/web/cweb). There are no functional changes compared to CWEBPC, Version p5. Thus, if you have this version running already, you don't need to upgrade. Hans-Hermann Bode Arbeitsgruppe Systemforschung, Universit\"at Osnabr\"uck Tel.: (49)-541-9692545 e-mail: HHBODE@DOSUNI1.BITNET ================================================================================ Archive-Date: Fri, 21 Aug 1992 11:03:56 CDT Date: Fri, 21 Aug 1992 9:03:06 -0700 (PDT) From: BEEZER@UPS.EDU (Rob Beezer) Reply-To: LitProg@SHSU.edu Message-ID: <920821090306.9a6d@UPS.EDU> Subject: Problems with @o in FWEB To: litprog@shsu.edu Johannes Mueller posted an question recently about using the @o command in FWEB. The following is taken directly from the read_me file distributed with FWEB: ############################################################################### ------------------------ v1.23b (not released to public) --------------------- FTANGLE: * Trouble with @o (still!) on some machines; spurious characters in file names. Fixed. ################################################################################ ............................................................................ : Robert Beezer : Internet: beezer@ups.edu : : Dept. of Mathematics and CS : Voice: 206.756.3564 : : University of Puget Sound : Fax: 206.756.3500 : : Tacoma, WA 98416 : : ............................................................................ ================================================================================ Archive-Date: Fri, 21 Aug 1992 16:50:04 CDT Message-ID: <9208212046.AA19489@sacpms.domain> To: litprog@SHSU.edu Subject: CWEB Date: Fri, 21 Aug 92 13:45:59 +1000 From: Dave Carlton Reply-To: LitProg@SHSU.edu I have been reading this list for some time now and have trying to glean exactly what is Literate Programming, WEB, CWEB, and such. I was hoping for a FAQ to come along but have not seen one. So, could someone please explain what is this all about, why is it good/bad. How can I try it out (on Unix BSD4.3 and Mac), and etc. Perhaps the responses could be gathered for a FAQ list. ================================================================================ Archive-Date: Sat, 22 Aug 1992 09:04:54 CDT Date: Sat, 22 Aug 92 16:04:36 +0200 From: Marcus Speh Reply-To: LitProg@SHSU.edu To: Literate Programmers Subject: Query: FWEB release v1.23b? I am referring to a recent posting by Rob Beezer concerning the @o command in FWEB. Later, Rob said: > the read_me file > that I quoted from was included in Hans-Hermann Bode's distribution of > the compiled versions of FWEB for the PC. Now, does anyone on the list know more about FWEB's version 1.23b - the "official" release which can be obtained from lyman.pppl.gov or from Niord.shsu.edu, is version 1.23a ? Using FWEB quite a lot for a couple of months now, I have not encountered any bug (yet) - maybe because I am cautious not to use too many of its features (of which there a too many, I am afraid - I'd like it a bit more minimalistic). An important point, esp for beginners, is the User's manual which contains a hell of a lot of information - on more than 200 pages. The problem is that it is quite a jungle to get lost in - written along the evolution of FWEB. That would be a substantial improvement even if now new code would have been written. BTW, it puzzles me that neither John Krommes, nor Norman Ramsey nor... whoever belongs to the elite club of original programmers of parts of the WEB variants, are subscribed to this list (acc to a REVIEW from August 20) ...did someone bother to tell them about its existence? M. Speh =================================================================== Marcus Speh INTERnet II. Institut f. Theor. Physik BITnet Luruper Chaussee 149 DECnet <13313::SPEH> 2000 Hamburg 50/Germany Tel.(040)8998-2260 FAX:(040)8998-2267 ================================================================================ Archive-Date: Sat, 22 Aug 1992 13:08:36 CDT Date: Sat, 22 Aug 92 20:08:12 +0200 From: Marcus Speh Reply-To: LitProg@SHSU.edu To: LitProg@SHSU.edu Subject: LP-FAQ outline References: <9208212046.AA19489@sacpms.domain> >>>>> On Fri, 21 Aug 92 13:45:59 +1000, Dave Carlton said: > I have been reading this list for some time now and have trying > to glean exactly what is Literate Programming, WEB, CWEB, and such. > I was hoping for a FAQ to come along but have not seen one. I second Dave Carlton's hope for a FAQ, and I have been volunteering today to participate in a FAQ for this list - we'll see how George Greenwade thinks about it... CAVEAT: since I consider myself ignorant on many LP related questions, I am afraid I will not have to offer too much besides enthusiasm and some FWEB experience, as well as a bunch of sample written in ratfor(1) (- no doubt FORTRAN is the secret love of the majority of experts on this list ;-) so I urge the *real* experts so come together and satisfy the novice's embryonic needs. Now, before anything else is being done, I'd like to open a discussion on what the LP FAQ should contain - the people interested should express their wishes. Below I have given a vague description of how I think the FAQ could look. I should confess that the FAQ image I have in mind is Joe Wells' FAQ for GNU Emacs (from the gnu. newsgroups) - but I haven't seen many examples yet. I have converted it into a Texinfo file (for both online info and a printed TeX-documentation - even without Emacs as an editor) here at DESY, and it was exceptionally well received by many novices. Since LP is very much a philosophy, too, spanning a vast number of possible applications and implementations, I think it would be nice to let the finished FAQ be "refereed" by some real experts, who should give comments and correct errors. I'd like to propose [for discussion!] an outline for the FAQ. ---------------------------------------------------------------------- FAQ file forms: text (.ps ? .texinfo ? .info ? .tex ?) @* CONTENTS. @= Notation, How to get this, What is planned etc. @= { Philosophy; /* What I like most about LP... Implementations; /* CWEB, FWEB, NOWEB, SPIDERWEB ...etc. Code Examples; /* mainly FILESERV Developpers; /* WEB variants, pointers to Addresses... Bibliography; /* started on this list, see also Beebe/FILESERV Addresses; /* Who's Who in LP... } @ Sections = Questions and longer paragraphs - later, for more intricate questions one may ask an expert to write a couple of lines; this is also the place for people's experiences with LP. ---------------------------------------------------------------------- M. Speh =================================================================== Marcus Speh INTERnet II. Institut f. Theor. Physik BITnet Luruper Chaussee 149 DECnet <13313::SPEH> 2000 Hamburg 50/Germany Tel.(040)8998-2260 FAX:(040)8998-2267 ================================================================================ Archive-Date: Sat, 22 Aug 1992 13:10:07 CDT Date: Sat, 22 Aug 92 20:09:43 +0200 From: Marcus Speh Reply-To: LitProg@SHSU.edu To: Literate Programmers Subject: Pointer to LITPROG for NOVICES As a very pointer to several questions of implementation and WEB variants, this is an edited copy from my Mail header list - in his regular posting, George Greenwade says how to get the postings this list is pointing at: " The archives of LitProg are maintained on the Sam Houston State University file server, FILESERV@SHSU.BITNET (FILESERV@SHSU.edu -- note that this is FILEserv and not LISTserv). To get a copy of any month's postings, send MAIL to FILESERV with the message: SENDME LitProg.yyyy-mm where "yyyy" is the year and "mm" is the numeric representation of the month. For example, the message SENDME LitProg.1992-07 will access the archives for July, 1992." [You can also get the via anonymous FTP from niord.shsu.edu, in directory FILESERV/LITPROG] The following lists contains some selected messages - no technicalities, no(t very much philosophy) - just a cocktail of 25 out of > 130 contributions which might be helpful for novices. I do not know yet whether such a selection is an allowed or a good thing at all...I did not scan *everything*, so don't be upset if you contributed and do not find yours scintillating comment here! The following categories are marked in the first column (some articles contain more than one - e.g. an Implementation is often accompanied by a definition): I = Implementation (eg. "I installed CWEB on the MAC!") E = Experiences (eg. "Why I am happy with NOWEB!") D = Definition (eg. "What is FWEB, dammit?") W = Where-from (eg. "Where can I get WEB for the MAC?") ------------------------------------------------------------------------------ I Thorsten Ohl Jul 21 46/2263 "FWEB for the PC?" E Cameron Smith Jul 21 71/3885 "WEB-less literate programming" I,E Cameron Smith Jul 22 35/1952 "New version of CWEB sample program" D Dave Love Jul 22 19/929 "noweb [was Re: FWEB for the PC?]" I Timothy Murphy Jul 22 79/2980 "Re: WEB for Macintosh, Turbo C++" D,E "Donald N. Petche Jul 22 15/747 "Re: WEB for Macintosh, Turbo C++" W Jonathan M. Gilli Jul 22 35/1648 "Literate Programming in the Real..." D,E Thorsten Ohl Jul 23 51/2272 "ANSI CWEB (was: Re: WEB for Maci..." I Hans-Hermann Bode Jul 23 51/2727 "CWEB for ANSI C, C++, Turbo C++" W "George D. Greenw Jul 23 78/4276 "CWEB, v 2.4, on FILESERV/Niord" E Don Hosek Jul 23 42/1644 "Re: Literate Programming in the ..." W "George D. Greenw Jul 27 56/3047 "Re: Web for Macintosh" E Mike Yoder Aug 2 118/6703 "not liking literate programming" E Mike Yoder Aug 2 41/2393 ""Veterans, rise up"" E Mike Yoder Aug 2 59/3398 "Sorry!" D,I Stephan Eggermont Aug 3 41/1937 "Re: Other LP tools?" D,I Cameron Smith Aug 3 59/3421 "RE: Other LP tools?" E Thorsten Ohl Aug 4 29/1359 "documenting changing code" E,W Thorsten Ohl Aug 4 24/1295 "RE: Other LP tools?" W "George D. Greenw Aug 04 92/4814 "NOWEB (version 2.1) on FILESERV/Niord" W "Nelson H. F. Bee Aug 5 34/1147 "Bibliography of literate programming" E Bart Childs Aug 5 73/3814 "LP is not necessarily monolithic" W Lee Wittenberg Aug 5 8/319 "Spidery WEB for PC" E,W "Jack W. Sharer 8 Aug 6 134/5318 "Ada WEBs" I,W Hans-Hermann Bode Aug 21 27/1343 "CWEB-p/portable WEB for ANSI-C/C++" ------------------------------------------------------------------------------ Hope that helps, M. Speh =================================================================== Marcus Speh INTERnet II. Institut f. Theor. Physik BITnet Luruper Chaussee 149 DECnet <13313::SPEH> 2000 Hamburg 50/Germany Tel.(040)8998-2260 FAX:(040)8998-2267 ================================================================================ Archive-Date: Sun, 23 Aug 1992 10:29:19 CDT Date: Sun, 23 Aug 92 16:17 GMT From: Rob Heyes Subject: == No Subject[] == To: LITPROG@shsu.edu CC: rheyes@cix.compulink.co.uk Reply-To: LitProg@SHSU.edu Message-ID: SUBSCRIBE LITPROG "Robert Alan Heyes" ================================================================================ Archive-Date: Mon, 24 Aug 1992 06:53:48 CDT Date: 24 Aug 1992 13:38 +0000 (GMT) From: "Eric W. van Ammers, LUW, tel: (+31)8370-83356" Reply-To: LitProg@SHSU.edu Subject: Suggestion for a FAQ on LP To: LITPROG@shsu.edu Message-ID: <01GNYMQ1WHJK9D8L62@RCL.WAU.NL> The LITPROG discussion list is a good initiative. It was very sad when Van Wyk decided to stop the literate programming column in CACM. He observed that all contributions to his column came from people who had written their own LP-system and this made him wonder how widespread LP would ever become. However, he promised to continue the column as soon as people start writing literate programs using tools made by others. No doubt the LITPROG discussion list can be quite valuable in this respect. Therefore I propose that the list of Frequently Asked Questions (FAQ) on LP maintains an overview of tools for literate programming, together with their particular strong and weak points. In parallel we should compile a list of desirable properties users feel a LP-system should possess in general. I expect that from this information rather soon an LP-tool will evolve that suits a wide audience. Eric W. van Ammers ================================================================================ Archive-Date: Mon, 24 Aug 1992 07:37:57 CDT From: Timothy Murphy Reply-To: LitProg@SHSU.edu Subject: Re: Suggestion for a FAQ on LP To: LitProg@SHSU.edu Date: Mon, 24 Aug 92 13:36:27 BST Sender: tim@maths.tcd.ie Message-ID: <9208241336.aa05593@salmon.maths.tcd.ie> A tiny point. Could the abbreviation LP please {\em not} be used for LitProg. Traditionally it stands for LinePrinter, and its use in another sense will only cause confusion. Timothy Murphy e-mail: tim@maths.tcd.ie tel: +353-1-2842366 (home/office) +353-1-7021507 (university) fax: +353-1-2842295 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland ================================================================================ Archive-Date: Mon, 24 Aug 1992 09:00:26 CDT Date: Mon, 24 Aug 92 08:57:10 CDT From: bart@cs.tamu.edu (Bart Childs) Reply-To: LitProg@SHSU.edu Message-ID: <9208241357.AA28329@neuron.cs.tamu.edu> To: LitProg@shsu.edu Subject: Acronym Mnemonic ... Tim brought up a good point. Many of us are also used to LP meaning Linear Programming. Gee, I wish there way to get a clean vote and we agree to use LitPgm, LitProg, LPR (which is what I think of a Line printer), or ??? Bart Childs ================================================================================ Archive-Date: Mon, 24 Aug 1992 09:52:17 CDT Date: Mon, 24 Aug 1992 09:50:32 -0500 From: Cameron Smith Reply-To: LitProg@SHSU.edu Message-ID: <199208241450.AA07535@mira.math.uiuc.edu> To: LitProg@SHSU.edu Subject: Re: Acronym Mnemonic ... Bart Childs writes: > ... Many of us are also used to LP meaning Linear Programming. > Gee, I wish there way to get a clean vote and we agree to use > LitPgm, LitProg, LPR (which is what I think of a Line printer), or ??? Well, my opinion is that it's appropriate to use the shortest, handiest abbreviation and let context disambiguate it -- after all, "LP" also refers to a certain type of phonograph record, but I don't think that's caused any confusion in this forum! If it becomes common to print Literate Programs on Line Printers by means of Linear Programming algorithms, while listening to music recorded on Long Playing records, then maybe we'll have to face this problem... but until an actual conflict of usage appears I'd favor using the short abbreviation. In fact, since this is a Literate Programming forum, if a conflict *did* arise I'd be inclined to say that it's the other terms that should acquire new shorthand (for use within this forum): how about keeping LPR for line printer, and using LinProg for Linear Programming? But if we *do* adopt something other than "LP" as the standard abbreviation for Literate Programming, then *please* let it be something as easily pronounceable as "LP" is. "LitProg" is OK with me (after all, I picked that name for this list in the first place), but "LitPgm" is right out -- how am I supposed to pronounce that, "litpiggem"? :-) --Cameron Smith cameron@symcom.math.uiuc.edu P.S. I was away for a week; I'm back for 4 days, then gone for another week. If email doesn't get a prompt response, please don't think I'm ignoring you! ================================================================================ Archive-Date: Mon, 24 Aug 1992 21:16:10 CDT Date: Mon, 24 Aug 1992 16:34:37 +22313801 (EDT From: Joey Gibson Reply-To: LitProg@SHSU.edu Subject: Sections references in FWeb? To: LitProg Mail-List Message-ID: I may have missed this in the FWeb docs, but is it possible to reference a section in a web, from another section? For example, can I have: ``For info on porting, see section 5'' and have it kept current for me automagically? Joey Gibson => "In the country of the blind, the one-eyed man is king." H.G. Wells <= ===> The views expressed here are not necessarily those of EMA. <== ================================================================================ Archive-Date: Mon, 24 Aug 1992 22:55:43 CDT Message-ID: <199208250333.AA09828@mucket.vast.unsw.edu.au> To: LitProg@SHSU.edu CC: LitProg Mail-List Subject: Re: Sections references in FWeb? Date: Tue, 25 Aug 92 13:33:05 +1000 From: stevea@vast.unsw.edu.au Reply-To: LitProg@SHSU.edu Joey Gibson sez: joey> I may have missed this in the FWeb docs, but is it possible to joey> reference a section in a web, from another section? For example, joey> can I have: joey> ``For info on porting, see section 5'' joey> and have it kept current for me automagically? You can always cheat, and do what I do for spidery web. Somewhere after you start the module, just throw in something like \let\refporting=\modno and then reference it by "see section~\refporting". Works for me. cheers -steve ================================================================================ Archive-Date: Tue, 25 Aug 1992 02:33:00 CDT Date: 25 Aug 1992 09:29 +0000 (GMT) From: "Eric W. van Ammers, LUW, tel: (+31)8370-83356" Reply-To: LitProg@SHSU.edu Subject: Re: Acronym Mnemonic ... To: LitProg@SHSU.edu Message-ID: <01GNZSBGMSJK9D8WBJ@RCL.WAU.NL> I fully agree with Cameron Smith's ideas on acronyms for literate programming. My prefrence is definitely "LP", but I'm willing to live with "litprog". Eric W. van Ammers ================================================================================ Archive-Date: Tue, 25 Aug 1992 03:42:15 CDT From: dan@minster.york.ac.uk Reply-To: LitProg@SHSU.edu Date: Tue, 25 Aug 92 09:38:33 Message-ID: To: LitProg@SHSU.edu Subject: Re: Acronym Mnemonic ... Eric W. van Ammers writes: > I fully agree with Cameron Smith's ideas on acronyms for literate programming. > My prefrence is definitely "LP", but I'm willing to live with "litprog". I agree with the above. LP is fine; litprog 2nd best choice. Let's have a vote... -dan ================================================================================ Archive-Date: Tue, 25 Aug 1992 04:40:29 CDT Date: Tue, 25 Aug 92 11:15:22 +0200 From: Marcus Speh Reply-To: LitProg@SHSU.edu To: LitProg@SHSU.edu Subject: Re: Sections references in FWeb? References: >>>>> On Mon, 24 Aug 1992 Joey Gibson said: > I may have missed this in the FWeb docs, but is it possible to reference a > section in a web, from another section? For example, can I have: > ``For info on porting, see section 5'' In FWEB, this would be done by the following construct: ----------------------------------------------------------- @ Porting. \modlabel{PORTING} ... more ... @ ANOTHER SECTION. For info on Porting, see \WEBsection{PORTING}. ----------------------------------------------------------- I.e. "section" is inserted automagically. [Explained in the FWEB v1.23a User's Manual, page 128, sec. 19.7.18 - more details are given there] -marcus =================================================================== Marcus Speh INTERnet II. Institut f. Theor. Physik BITnet Luruper Chaussee 149 DECnet <13313::SPEH> 2000 Hamburg 50/Germany Tel.(040)8998-2260 FAX:(040)8998-2267 ================================================================================ Archive-Date: Wed, 26 Aug 1992 13:22:29 CDT From: jw24@sgi6.york.ac.uk (J Waldmann) Reply-To: LitProg@SHSU.edu Message-ID: <9208261821.AA01719@sgi6.york.ac.uk> Subject: TANGLE: Identifiers, Numbers To: litprog@shsu.edu (literate programming mailing list) Date: Wed, 26 Aug 92 19:21:40 BST As I see from the archives, this list is mostly on philosophy. :-) For a change, here's some technicalities: 1) Is there a way to get 32 bit numerical values during macro expansions and arithmetics in tangle? Lots of pascal compilers could easily handle such numbers. It shouldn't be too hard to modify tangle.web or better tangle.ch to achieve this, but maybe someone has done so already. Or is it a sacrifice to do so? 2) Normally, in between alpha characters, underscores are removed from names. But if an identifier *starts* with an underscore, tangle treats this character like an unary plus and thus copies it into the .pas file. Is this considered useful or, as I do, irritating? Again, a slight modification to tangle's central character reading loop would fix the problem by just declaring the underscore as an ordinary character. -- Regards --- Johannes Waldmann currently: jw24@tower.york.ac.uk / from oct 92 on: mwj@mathematik.uni-jena.de ================================================================================ Archive-Date: Wed, 26 Aug 1992 17:19:27 CDT From: Timothy Murphy Reply-To: LitProg@SHSU.edu Subject: Re: TANGLE: Identifiers, Numbers To: LitProg@shsu.edu Date: Wed, 26 Aug 92 23:16:32 BST Sender: tim@maths.tcd.ie Message-ID: <9208262316.aa28810@salmon.maths.tcd.ie> > 1) Is there a way to get 32 bit numerical values during macro expansions > and arithmetics in tangle? Lots of pascal compilers could easily handle > such numbers. Note that you can write @d x==1234567 (using == rather than =). Most compilers nowadays would do the arithmetic that tangle does at compile-time rather than run-time, so it hardly seems worth worrying about. I'd have thought there would be a stronger argument for simplifying tangle by removing this facility (for internal arithmetic) altogether. I think Cweb has done this. Timothy Murphy e-mail: tim@maths.tcd.ie tel: +353-1-2842366 (home/office) +353-1-7021507 (university) fax: +353-1-2842295 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland ================================================================================ Archive-Date: Wed, 26 Aug 1992 18:25:20 CDT Date: Wed, 26 Aug 92 18:20:56 CDT From: bart@cs.tamu.edu (Bart Childs) Reply-To: LitProg@SHSU.edu Message-ID: <9208262320.AA22208@neuron.cs.tamu.edu> To: litprog@shsu.edu Subject: Fixed up Tangle.ch I have mailed one to `yw24' that I think fixes his requests. I agree that the fixes should have been done. When Don Knuth did his original WEB the world was quite different. He intended the pascal to be `unfit for human comsumption.' The change file has several other little fixes of the same type and is approximately twice the length of the one at labrea. A part of that is because the changes always address complete modules. Bart Childs ================================================================================ Archive-Date: Wed, 26 Aug 1992 18:41:05 CDT From: Timothy Murphy Reply-To: LitProg@SHSU.edu Subject: Re: Fixed up Tangle.ch To: LitProg@shsu.edu Date: Thu, 27 Aug 92 0:38:36 BST Sender: tim@maths.tcd.ie Message-ID: <9208270038.aa29968@salmon.maths.tcd.ie> > I agree that the fixes should have been done. When Don Knuth > did his original WEB the world was quite different. He intended > the pascal to be `unfit for human comsumption.' Does this mean you feed yourself on tangled code? IMHO, tangle ain't broken, so there's no need to mend it. Doesn't everyone use web2c anyway? Timothy Murphy e-mail: tim@maths.tcd.ie tel: +353-1-2842366 (home/office) +353-1-7021507 (university) fax: +353-1-2842295 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland ================================================================================ Archive-Date: Thu, 27 Aug 1992 04:12:04 CDT From: Joachim Schrod Reply-To: LitProg@SHSU.edu Message-ID: <9208270910.AA08530@hp5.iti.informatik.th-darmstadt.de> Subject: Re: TANGLE: Identifiers, Numbers To: LitProg@SHSU.edu Date: Thu, 27 Aug 92 11:10:26 MESZ If you have the fixes (at best in form of a changefile ;-) ready, it would be very nice if you would redistribute them again. E.g., you might put them via anonymous ftp on ftp.th-darmstadt.de, directory pub/incoming and send me a mail. I will forward them to all larger archives. Thank you in advance. -- Joachim =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Joachim Schrod Email: schrod@iti.informatik.th-darmstadt.de Computer Science Department Technical University of Darmstadt, Germany ``How do we persuade new users that spreading fonts across the page like peanut butter across hot toast is not necessarily the route to typographic excellence? -- Peter Flynn ================================================================================ Archive-Date: Thu, 27 Aug 1992 04:32:54 CDT From: Joachim Schrod Reply-To: LitProg@SHSU.edu Message-ID: <9208270931.AA08554@hp5.iti.informatik.th-darmstadt.de> Subject: Re: TANGLE: Identifiers, Numbers To: LitProg@SHSU.edu Date: Thu, 27 Aug 92 11:31:12 MESZ You wrote: > > Note that you can write > > @d x==1234567 > > (using == rather than =). > Most compilers nowadays would do the arithmetic that tangle does > at compile-time rather than run-time, > so it hardly seems worth worrying about. > > I'd have thought there would be a stronger argument > for simplifying tangle by removing this facility > (for internal arithmetic) altogether. > > I think Cweb has done this. In C it is defined that constant expressions may be used in declarations. This is not the case for ISO Pascal. I.e., assuming a defined type identifier `T' and a constant `size', T field[size+1]; is a valid C declaration, while var field: array [size+1] of T; is illegal Pascal code. That many compilers do support it, does not change this fact. Since this code is useful, and since a WEB system should support the standard definition of a language, a Pascal WEB should make available the substitution of constant expressions with a constant. The comparison to Cweb is not relevant here. -- Joachim =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Joachim Schrod Email: schrod@iti.informatik.th-darmstadt.de Computer Science Department Technical University of Darmstadt, Germany ``How do we persuade new users that spreading fonts across the page like peanut butter across hot toast is not necessarily the route to typographic excellence? -- Peter Flynn ================================================================================ Archive-Date: Thu, 27 Aug 1992 04:36:14 CDT From: Joachim Schrod Reply-To: LitProg@SHSU.edu Message-ID: <9208270934.AA08573@hp5.iti.informatik.th-darmstadt.de> Subject: Re: Fixed up Tangle.ch To: LitProg@SHSU.edu Date: Thu, 27 Aug 92 11:34:28 MESZ You wrote: > > Doesn't everyone use web2c anyway? It seems hard to believe to some folks, but the answer is no: Not everyone is working on a system with a UNIX API. -- Joachim =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Joachim Schrod Email: schrod@iti.informatik.th-darmstadt.de Computer Science Department Technical University of Darmstadt, Germany ``How do we persuade new users that spreading fonts across the page like peanut butter across hot toast is not necessarily the route to typographic excellence? -- Peter Flynn ================================================================================ Archive-Date: Thu, 27 Aug 1992 11:49:49 CDT From: jw24@sgi11.york.ac.uk (J Waldmann) Reply-To: LitProg@SHSU.edu Message-ID: <9208271648.AA02067@sgi11.york.ac.uk> Subject: Ada formatter To: litprog@shsu.edu (literate programming mailing list) Date: Thu, 27 Aug 92 17:48:35 BST Is there a program that takes a plain Ada source and produces a nice .tex from it? I know that's not very `literate' but I only want - (often used) reserved words in boldface, - linebreaks and indentation exactly as in the source and possibly - Ada comments interpreted as TeX or LaTeX BTW, thanks for replies on the tangle questions. -- Regards --- Johannes Waldmann currently: jw24@tower.york.ac.uk / from oct 92 on: mwj@mathematik.uni-jena.de ================================================================================ Archive-Date: Thu, 27 Aug 1992 19:56:58 CDT Message-ID: <199208272356.AA11538@mucket.vast.unsw.edu.au> To: LitProg@SHSU.edu Subject: Re: Ada formatter Date: Fri, 28 Aug 92 09:56:27 +1000 From: stevea@vast.unsw.edu.au Reply-To: LitProg@SHSU.edu Johannes sez: johannes> Is there a program that takes a plain Ada source and johannes> produces a nice .tex from it? I know that's not very johannes> `literate' but I only want johannes> - (often used) reserved words in boldface, johannes> - linebreaks and indentation exactly as in the source johannes> and possibly johannes> - Ada comments interpreted as TeX or LaTeX Ummm, probably tgrind is your best bet. Its available, I would think, from the usual places (ymir, etc). You may have to write your own vgrindefs for Ada, but it isn't very hard to do (I've done it for an HDL we run here, and it takes only an hour or so). It only produces TeX, so you may have to hack it a bit to get LaTeX. ObLP: You should consider using Spidery Ada WEB from now on :-) cheers -steve ================================================================================ Archive-Date: Sat, 29 Aug 1992 08:29:45 CDT Date: 29 Aug 1992 09:27:38 -0400 (EDT) From: bbeeton Reply-To: LitProg@SHSU.edu Subject: message about cweb and web from don knuth To: litprog@shsu.edu Message-ID: <715094858.316689.BNB@MATH.AMS.ORG> recently, i forwarded to don knuth a message about cweb, and received the attached reply. i think it's of general interest to this group. (silvio is silvio levy.) as background, i must explain that for several years, i've been acting as a semi-official agent, forwarding bug reports about tex and friends; ordinarily knuth prefers to receive such reports on paper, but he allows me to send them electronically to his secretary. anyone who has a well-documented report of a real bug can forward it through me, or send it by regular post to knuth at the address shown in the tug membership list. bug reports sent to me for forwarding will be vetted before they go to knuth; anything that is found to be spurious, or in the nature of a suggestion rather than a bug will be politely returned to the sender. -- bb -------------------- Date: 28 Aug 1992 22:26:13 -0700 To: bnb@MATH.AMS.ORG Subject: note from Don You asked about the status of CWEB: Yes, it has indeed taken on a life of its own. I expect it will be my programming language for the rest\ of my life, and I'm actively maintaining it (with Silvio), currently trying to make it better for systems programming (since it will greatly improve all existing systems!!) and more portable to varieties of C compilers. The CWEB master sources are now in their own directory at labrea; the previous cweb subdirectory of the tex sources now contains just a pointer to the main cweb directory. WEB, on the other hand, is part of TeX and no longer being maintained except for catastrophic errors; maybe even catastrophic errors will be regarded as features, in fact, because I think WEB has evolved to a desirable stable state. Those who wish to change it have made their change files; any changes to WEB itself will screw up those numerous change files.