| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (13 out of 13)

Mixing Error Handling Techniques

Error handling in G2 4.0 used a symbol and a text string, rather than an object, to describe an error. The essential nature of G2 4.0 error handling is the same as in G2 5.0, but the syntax is different: in the G2 4.0 implementation, the on error and signal statements each take two arguments - the symbol and the text string that describe the error - rather than one.

The syntax of the G2 4.0 error handling statements is described under Superseded On Error Statement Syntax and Superseded Signal Statement Syntax.

G2 distinguishes between the G2 4.0 and 5.0 on error and signal statements by the number of arguments in the statement. To allow code to mix the two techniques without requiring special action, G2 automatically interconverts between them. Such interconversion is possible because:

The following table shows how G2 interconverts between one-argument and two-argument error handling.


Note: The object-oriented default error handler is effectively a one-argument on error statement.

| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (13 out of 13)

Copyright © 1997 Gensym Corporation, Inc.