Changeset 3946
- Timestamp:
- 09/21/03 01:56:15 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/make_condition.java
r3926 r3946 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: make_condition.java,v 1. 1 2003-09-20 16:56:33piso Exp $5 * $Id: make_condition.java,v 1.2 2003-09-21 01:56:15 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 22 22 package org.armedbear.lisp; 23 23 24 // ### make-condition 24 25 public final class make_condition extends Primitive 25 26 { … … 29 30 } 30 31 32 // make-condition type &rest slot-initializations => condition 31 33 public LispObject execute(LispObject[] args) throws ConditionThrowable 32 34 { 33 return new Condition(); 35 if (args.length < 1) 36 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 37 LispObject type = args[0]; 38 LispObject initArgs = NIL; 39 for (int i = args.length; i-- > 1;) 40 initArgs = new Cons(args[i], initArgs); 41 if (type == Symbol.CONDITION) 42 return new Condition(initArgs); 43 if (type == Symbol.SIMPLE_CONDITION) 44 return new SimpleCondition(initArgs); 45 if (type == Symbol.ERROR) 46 return new LispError(initArgs); 47 if (type == Symbol.SIMPLE_ERROR) 48 return new SimpleError(initArgs); 49 if (type == Symbol.UNBOUND_VARIABLE) 50 return new UnboundVariable(initArgs); 51 if (type == Symbol.UNDEFINED_FUNCTION) 52 return new UndefinedFunction(initArgs); 53 throw new ConditionThrowable(new LispError("MAKE-CONDITION: unsupported type " + type)); 34 54 } 35 55
Note: See TracChangeset
for help on using the changeset viewer.