public StructureObject(Symbol symbol, LispObject obj0) { structureClass = (StructureClass) LispClass.findClass(symbol); // Might return null. LispObject[] slots = new LispObject[1]; slots[0] = obj0; this.slots = slots; }
public StructureObject( Symbol symbol, LispObject obj0, LispObject obj1, LispObject obj2, LispObject obj3) { structureClass = (StructureClass) LispClass.findClass(symbol); // Might return null. LispObject[] slots = new LispObject[4]; slots[0] = obj0; slots[1] = obj1; slots[2] = obj2; slots[3] = obj3; this.slots = slots; }
@Override public LispObject typep(LispObject type) { if (type instanceof StructureClass) return memq(type, structureClass.getCPL()) ? T : NIL; if (type == structureClass.getName()) return T; if (type == Symbol.STRUCTURE_OBJECT) return T; if (type == BuiltInClass.STRUCTURE_OBJECT) return T; if (type instanceof Symbol) { LispClass c = LispClass.findClass((Symbol) type); if (c != null) return memq(c, structureClass.getCPL()) ? T : NIL; } return super.typep(type); }
public StructureObject(Symbol symbol) { structureClass = (StructureClass) LispClass.findClass(symbol /*, true*/); // Might return null. if (structureClass == null) { System.err.println("No mitens sitten: " + BuiltInClass.SYSTEM_STREAM.toString()); System.err.println("joopa joo:" + Symbol.SYSTEM_STREAM.name); System.err.println( "Oh noes, structure object got a null class:" + symbol.toString() + ", symbol name:" + symbol.name); } slots = new LispObject[0]; }
public StructureObject(Symbol symbol, LispObject[] slots) { structureClass = (StructureClass) LispClass.findClass(symbol); // Might return null. this.slots = slots; }