01: package kawa.standard;
02:
03: import kawa.lang.*;
04: import gnu.mapping.*;
05:
06: public class throw_name extends ProcedureN {
07: public static final throw_name throwName = new throw_name();
08:
09: public Object applyN(Object[] args) throws Throwable {
10: int len = args.length;
11: if (len > 0) {
12: Object key = args[0];
13: if (key instanceof Throwable) {
14: if (args.length == 1)
15: prim_throw.throw_it(key);
16: } else if (key instanceof String)
17: throw new NamedException((String) key, args);
18: }
19: throw (new GenericError("bad arguments to throw"));
20: }
21: }
|