All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----Jaja.Jaja | +----Jaja.Value | +----Jaja.Symbol | +----Jaja.SpecialOperator | +----Jaja.Monitor
The monitor special form catches anomalies (aka Jaja exceptions) or Java runtime exceptions. The latter are always non continuable (the stack is unwinded before Jaja gets control again). The former are diagnosed (aka raised in Jaja parlance) in some special circumstances and may be continuable or not. To continue a non continuable anomaly raises another (non continuable) anomaly.
Not all erroneous situations lead to anomalies since that detection is expensive (in time and space). The compiler generates code that performs verifications by simple cast expressions instead of generating type checks. Once one has an ClassCastException, one may read the code of Jaja at the accompanying line number and get an idea of the invalid type error.
protected Monitor()
public Value perform(Value parameters, Environment r, WorldAble world)
public static Value diagnose(Value exception, Value continuable)
Exceptions may be raised by the diagnose function. If the exception is continuable then the handler is run in the dynamic context of the exception except that it is now monitored by the handler that was previously current.
public static HandlerLink createInitialHandler(Value handler)
All Packages Class Hierarchy This Package Previous Next Index