| Version 1.9 Build 1556
|
|
Next: Predefined Functions and Variables
Up: Debugging, Logging, and Error Handling
Previous: Input/Output Logging
Trace
Despite careful design a Glish script sometimes refuses to execute
properly and may appear to be non-determinate. With most languages, this type of
debugging is handled with a symbolic debugger. Glish doesn't have a symbolic
debugger (yet), but setting system.output.trace
to ``T''
causes Glish to
print out a breif summary of each statement just before it executes it. This can be
useful for debugging, and in some cases, it is even better than a symbolic debugger.
It is particularly useful for understanding the sometimes very compilcated interplay
of asynchronious events. This input:
func fib(n)
{
if ( n <= 1 ) return 1
return fib(n-1) + fib(n-2)
}
system.output.trace := T
fib(3)
generates output that looks like:
|-> fib(3)
|-> if (n <= 1)
|-> return (fib((n - 1)) + fib((n - 2)))
|-> fib((n - 1))
|-> if (n <= 1)
|-> return (fib((n - 1)) + fib((n - 2)))
|-> fib((n - 1))
|-> if (n <= 1)
|-> return 1
|-> fib((n - 2))
|-> if (n <= 1)
|-> return 1
|-> fib((n - 2))
|-> if (n <= 1)
|-> return 1
3
Next: Predefined Functions and Variables
Up: Debugging, Logging, and Error Handling
Previous: Input/Output Logging
  Contents
  Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc.,
Washington, D.C.
Return to AIPS++ Home Page
2006-10-15