Subject: StrictTCL (was Re: Self-documenting procs) - DN [1]


"Bruce S. O. Adams" <bruce.adams@rmc-ltd.com> - 12 Feb 1999 - comp.lang.tcl

 "Donal K. Fellows" wrote:

 > In article <36C40570.6006@mailserver.hursley.ibm.com>,
 > Paul Duffin  <pduffin@mailserver.hursley.ibm.com> wrote:
 > > I would say that an optional parameter to proc would probably be the
 > > best way but rather than just check the number of parameters I would
 > > rather see a -describe option. e.g.
 > >     proc fred {a b} -describe {
 > >       Takes two parameters and prints them out.
 > >     } {
 > >       puts "$a $b"
 > >     }
 >
 > [...]
 >
 > > Some other potential options for proc.
 > >
 > > -entryassertions <expressions|code>
 > >       Checked only when debugging
 > > -exitassertions       <expressions|code>
 > >       Checked only when debugging
 > > -compile <boolean>
 > >       To eliminate any slight changes in behaviour when compiled.
 > > -format <format>
 > >       To select the format for the description, e.g. XML, ?roff,
 > >       html.
 >
 > Ah!  That is superior to my suggestion by far by virtue of being more
 > extensible and yet still completely backward-compatible.  Other
 > options that it might be nice to add:
 >
 >   -argtype <typelist>
 >      Specifies what the types of the parameters to the procedure are,
 >      and might enable better debugging and compilation.
 >   -returntype <type>
 >      Specifies what the type of the returned value is, allowing better
 >      debugging and compilation again.
 >
 > (I'm not sure at all about that -format argument though.  But that is
 > only a minor complaint compared to the whole of your message's
 > inestimable wisdom and goodness.)
 >
 > Donal.
 > --
 > Donal K. Fellows    http://www.cs.man.ac.uk/~fellowsd/    fellowsd@cs.man.ac.uk
 > Department of Computer Science, University of Manchester, U.K. +44-161-275-6137
 > --
 >    "And remember, evidence is nothing." - Stacy Strock <spoon@adisfwb.com>

 We are adding features for grown up applications here.  I think this is a good
 thing but it should be
 done in a more coherent fashion.  We should to design a strict-TCL package that
 lets us do various
 things like assertion checking, optmisation flags etc.  That way we don't lose any
 of TCL rapid
 application development appeal.  This package would be used when stabilising the
 application.  This
 is only one approach to software engineering.  Other's might argue that such
 features should be
 used from the start.  For such people, all their scripts would start with package
 require strictTCL.
 This is another project I'd like to get involved in :-).
                                             Bruce S. O. Adams

Last modified
1999-09-27

(195.108.246.50)

Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated