Beispiel #1
0
 private void set(Map<LWord, LAtom> bindings, LWord name, LAtom value) {
   if (bindings.containsKey(name) && bindings.get(name) instanceof LList) {
     if (Primitives.prim((LList) bindings.get(name))) {
       throw new RuntimeError(this, RuntimeError.Type.MutatePrimitive, name.value);
     }
   }
   bindings.put(name, value);
 }
Beispiel #2
0
 /** Collect a callstack trace. */
 public List<LAtom> trace() {
   List<LAtom> ret = new ArrayList<LAtom>();
   for (int z = scopes.size() - 1; z >= 0; z--) {
     if (scopes.get(z).procedure && !Primitives.prim(scopes.get(z).code)) {
       ret.add(getName(scopes.get(z).code));
     }
   }
   return ret;
 }