Changeset 4098
- Timestamp:
- 09/28/03 14:58:43 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/LispClass.java
r3993 r4098 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispClass.java,v 1.2 6 2003-09-22 12:24:08piso Exp $5 * $Id: LispClass.java,v 1.27 2003-09-28 14:58:43 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 156 156 157 157 // ### find-class 158 // find-class symbol &optional errorp environment => class 158 159 private static final Primitive FIND_CLASS = new Primitive("find-class") { 159 public LispObject execute(LispObject[] args) throws ConditionThrowable 160 { 161 if (args.length < 1) 162 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 163 LispObject obj = (LispObject) map.get(checkSymbol(args[0])); 164 return obj != null ? obj : NIL; 160 public LispObject execute(LispObject symbol) throws ConditionThrowable 161 { 162 LispObject c = findClass(checkSymbol(symbol)); 163 if (c == null) { 164 StringBuffer sb = new StringBuffer("there is no class named "); 165 sb.append(symbol); 166 throw new ConditionThrowable(new LispError(sb.toString())); 167 } 168 return c; 169 } 170 public LispObject execute(LispObject symbol, LispObject errorp) 171 throws ConditionThrowable 172 { 173 LispObject c = findClass(checkSymbol(symbol)); 174 if (c == null) { 175 if (errorp != NIL) { 176 StringBuffer sb = new StringBuffer("there is no class named "); 177 sb.append(symbol); 178 throw new ConditionThrowable(new LispError(sb.toString())); 179 } 180 return NIL; 181 } 182 return c; 183 } 184 public LispObject execute(LispObject symbol, LispObject errorp, 185 LispObject environment) 186 throws ConditionThrowable 187 { 188 // FIXME Ignore environment. 189 return execute(symbol, errorp); 165 190 } 166 191 };
Note: See TracChangeset
for help on using the changeset viewer.