Chapter 10. Interactive Development and Debugging

Table of Contents

10.1. Interactive Mode Implementation
10.2. Getting On-Line Help for Functions
10.3. Examining Variables in a Class or Instance
10.4. Using the Debug Prompt
10.5. Debugging a program
10.5.1. Interacting with an Active Program
10.5.2. Trapping and Reporting Errors
10.5.3. Determining Error Location
10.5.4. Filtering Object Query Output

10.1. Interactive Mode Implementation

The implementation of Gamma's interactive mode provides an interesting example of the how to use the concise power of the language. Interactive mode is implemented with the following few lines of Gamma:

princ("Gamma> ");
flush(stdout);
while ((x = read( stdin)) != _eof_)
{
    princ( eval( x));
    terpri();
    princ("Gamma> ");
    flush(stdout);
}
	  

An application can easily provide its own customized [quot ] interactive mode [quot ] by executing a Gamma script file with a variation of this code that is entered when the file is loaded.