Ejemplo n.º 1
0
 private static final int computeHash(LispObject obj, int depth) {
   if (obj.isCons()) {
     if (depth > 0) {
       int n1 = computeHash(((Cons) obj).car, depth - 1);
       int n2 = computeHash(((Cons) obj).cdr, depth - 1);
       return n1 ^ n2;
     } else {
       // This number comes from SBCL, but since we're not really
       // using SBCL's SXHASH algorithm, it's probably not optimal.
       // But who knows?
       return 261835505;
     }
   } else return obj.sxhash();
 }