
             Reviewers guidelines for glish code

Ensure all code is either in a global function, a glish closure object
or a distributed object.

* General considerations
** All public functions and arguments are in lower case. Private
   functions may use mixed case and underscores.
** No use of underscores in public function/argument names unless
   imitating a glish builtin eg., is_image() imitates the glish
   is_record() function.
** minimal use of abbreviations in public function/argument names
   except for very common functions or abbreviations.
** not too many arguments to functions. ie keep it simple.
** all lines are properly indented. This is easiest done if the lines
   end with a semicolon and the code is edited in emacs or xemacs.
** pragma include once line exists.
** all necessary include files so that the glish script can be
   included independent of any other includes.
** Does not write messages to the user on the terminal. Instead it
   uses the facilities in note.g which will forward the message to the 
   logger if it is available. Alternately a status/help area that is
   created by the glish script using tk can be used for the messages.
** Minimise the use of defaulted arguments. One function should do one 
   thing only. eg obj.summary()                 - prints summary to the logger
                  obj.printsummary(printername) - prints summary to printer
   rather than    obj.summary(toprinter=F, printername='')
   Some discretion can be used with this point.
** logging is at an appropriate level and the origin of each message is 
   indicated as 'tool.function'.
** gui functions use the functions in the guiutils module whenever
   possible to ensure that a standard layout is
   presented to the user. All gui's should conform to standards
   currently under preparation by Bob Garwood. Gui functions should test if
   have_gui() is true.
** existence of a const global test function with a called  tobjectname()
   which executes every function, checks it returns expected results and
   returns T or F. Fail is an alternative for F. This function is to
   exist in a separate file called tfilename.g. 
** demo scripts are optional const global functions called dobjectname(),
   dobjectname1() ... These functions should be in seperate files
   called dfilename.g, dfilename1.g ....
** All test afunctions should suppress all gui output even at the
   expense of leaving gui-related functions untested. 
** test and demo files live in a subdirectory called 'test' below the
   main glish object.
** help file exists.

*** Is integrated into the reference manual with the appropriate links.
*** Both HTML and postscript versions markup with no errors
*** Is understandable and comprehensive.
*** Has important cross-references that work

* Global function guidelines
** Only to be used when absolutely necessary as they clutter the
   namespace and give rise to unexpected bugs later.
** Must be 'const'

* Glish closure object/distributed object guidelines
** Uses private and public records to hold the private & public functions
** Public functions do not overlap. ie there is only one function for
   doing a specific task.
** class name is a noun if there can be more than one of them (eg., table),
   or a verb if there is usually only one (eg., logger). Exception to
   this rule are allowed if they follow its spirit.
** main constructor is the name of the class.
** public record has been passed to the defaultattributes function
   just before returning. This function will:
   - make all the public functions const.
   - allows future global manipulation of the public record.
** the public record is returned by reference
** constructor returns a const object
** functions return fail if something goes wrong (or document what
   they do when things do not work). One way of doing this is to use
   the throw function in the utility module.
** Try and use common names amongst different objects. Current
   standards are:
*** open - attach the object to a file
*** summary - summarise the object state
*** gui - display the gui/browser/editor/displayer
*** done - disable the object, saving itself to disk if
           necessary. This function should free up resources used
           by the object and remove the DO process. This function
           should always be provided.
*** shape - the length of each axis on the object
*** length - the total number of values in the object.
*** ok - checks the object is consistent returns T or F (or Fail)
*** copy - does a deep copy of the closure so that if it can be passed
    into another closure and and used even if the external tool is
    deleted
** use defaultclass (and an abbreviation) for common objects
   that are premade by the script (eg defaultlogger aliased to dl).
** do not allow null objects. Every object should be functional.
** Is plugin enabled unless there is a reason not to do this.
** If an function interface needs to read data that may be in a table
   it accepts at least the following argument types:
   - string (table name)
   - tool of the relevant type.
   - and optionally a table tool (table type is checked).
   In the meta information the designer may choose one of the relevant
   input types as the primary type or use the 'untyped' type.

* Distributed object guidelines
** Uses version 2 of the DO system.
** C++ code is in class called myclass (and fileDOmyclass.{h,cc}).
   Classes derived from application object are the only C++ classes
   with a class name that is not capitalized. eg:
   C++ class:    aips/implement/ComponentModels/ComponentList.{h,cc}
   C++ test:     aips/implement/ComponentModels/test/tComponentList.cc
   C++ DO:       aips/implement/ComponentModels/DOcomponentlist.{h,cc}
   DO test:      aips/implement/ComponentModels/test/tDOcomponentlist.cc
   glish script: aips/implement/ComponentModels/componentlist.g
   glish test:   aips/implement/ComponentModels/test/tcomponentlist.g
   C++ app:      aips/apps/componentlist/componentlist.cc   
