01: package gnu.jemacs.lang;
02:
03: /** An exception thrown by (throw tag value) and caught by (catch tag body). */
04:
05: public class CatchableException extends RuntimeException {
06: Object tag;
07: Object value;
08:
09: public CatchableException(Object tag, Object value) {
10: this .tag = tag;
11: this .value = value;
12: }
13:
14: public Object match(Object catchTag) {
15: if (tag != catchTag)
16: throw this;
17: return value;
18: }
19: }
|