Re: (**) comments highlighted - newbie

*To*: mathgroup at smc.vnet.net*Subject*: [mg48792] Re: (**) comments highlighted - newbie*From*: Paul Abbott <paul at physics.uwa.edu.au>*Date*: Wed, 16 Jun 2004 07:48:54 -0400 (EDT)*Organization*: The University of Western Australia*References*: <cagibh$i8u$1@smc.vnet.net> <cajj95$eno$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

In article <cajj95$eno$1 at smc.vnet.net>, AES/newspost <siegman at stanford.edu> wrote: > While we're on this topic, it would also be nice if one could Merge a > sequence of Input and text or header cells, starting with an Input cell, > and have all the non-Input cells be auto-converted to comment lines. > > I like to develop and test longish routines by coding them as one Input > cell per statement so I can step down through the routine one cell at a > time, together with occasional comment cells in header or text format > interspersed between these input cells to remind me of what I'm doing. > > (*--I guess I could put the (* *) labels on the comment cells from the > start -- but why not let Mathematica do the work?--*) I think that it is preferable to develop packages as Notebooks, in which the documentation can be both extensive and nicely formatted, and use the autogeneration feature to automatically generate the Mathematica package. This allows you t break your code into understandable chunks, making your code easier to maintain, test, and understand. Modifying the Notebook StyleSheet allows you to write comments in any format that you choose. For a nice example, see the Notebook NotationSource.nb which (automatically) generates the Notation.m package (loaded as <<Utilities`Notation`), and is included with the standard distribution in the following directory: ToFileName[{$TopDirectory, "AddOns", "ExtraPackages","Utilities", "Documentation","English"}] Cheers, Paul -- Paul Abbott Phone: +61 8 9380 2734 School of Physics, M013 Fax: +61 8 9380 1014 The University of Western Australia (CRICOS Provider No 00126G) 35 Stirling Highway Crawley WA 6009 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul