Example #1
0
 @Override
 public LispObject getParts() {
   LispObject result = NIL;
   result = result.push(new Cons("class", structureClass));
   LispObject effectiveSlots = structureClass.getSlotDefinitions();
   LispObject[] effectiveSlotsArray = effectiveSlots.copyToArray();
   Debug.assertTrue(effectiveSlotsArray.length == slots.length);
   for (int i = 0; i < slots.length; i++) {
     SimpleVector slotDefinition = (SimpleVector) effectiveSlotsArray[i];
     LispObject slotName = slotDefinition.AREF(1);
     result = result.push(new Cons(slotName, slots[i]));
   }
   return result.nreverse();
 }
Example #2
0
 public Cons(Cons original) {
   Cons rest = original;
   LispObject result = NIL;
   while (rest.car() != NIL) {
     result = result.push(rest.car());
     if (rest.cdr() == NIL) {
       break;
     }
     rest = (Cons) rest.cdr();
   }
   result = result.nreverse();
   this.car = result.car();
   this.cdr = result.cdr();
   ++count;
 }