Changeset 4346
- Timestamp:
- 10/13/03 13:10:37 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/LispClass.java
r4311 r4346 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispClass.java,v 1.3 2 2003-10-11 18:48:09piso Exp $5 * $Id: LispClass.java,v 1.33 2003-10-13 13:10:37 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 171 171 } 172 172 173 // ### add-class174 private static final Primitive1 ADD_CLASS =175 new Primitive1("add-class", PACKAGE_SYS, false)176 {177 public LispObject execute(LispObject obj) throws ConditionThrowable178 {179 if (obj instanceof LispClass) {180 LispClass c = (LispClass) obj;181 addClass(c.getSymbol(), c);182 return c;183 }184 throw new ConditionThrowable(new TypeError(this, "class"));185 }186 };187 188 173 // ### find-class 189 174 // find-class symbol &optional errorp environment => class … … 222 207 }; 223 208 209 // ### %set-find-class 210 private static final Primitive2 _SET_FIND_CLASS = 211 new Primitive2("%set-find-class", PACKAGE_SYS, false) 212 { 213 public LispObject execute(LispObject first, LispObject second) 214 throws ConditionThrowable 215 { 216 Symbol symbol = checkSymbol(first); 217 if (second instanceof LispClass) { 218 addClass(symbol, (LispClass) second); 219 return second; 220 } 221 if (second == NIL) { 222 map.remove(symbol); 223 return second; 224 } 225 throw new ConditionThrowable(new TypeError(second, "class")); 226 } 227 }; 228 224 229 // ### class-name 225 230 private static final Primitive1 CLASS_NAME = new Primitive1("class-name")
Note: See TracChangeset
for help on using the changeset viewer.