Changeset 13310
- Timestamp:
- 06/07/11 18:07:33 (12 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/HashTableFunctions.java
r13309 r13310 413 413 }; 414 414 415 @DocString(name="hash-table-weakness", 416 args="hash-table", 417 doc="Return weakness property of HASH-TABLE, or NIL if it has none.") 418 private static final Primitive HASH_TABLE_WEAKNESS 419 = new pf_hash_table_weakness(); 420 private static final class pf_hash_table_weakness extends Primitive { 421 pf_hash_table_weakness() { 422 super(Symbol.HASH_TABLE_WEAKNESS, "hash-table"); 423 } 424 @Override 425 public LispObject execute(LispObject first) 426 { 427 if (first instanceof HashTable) { 428 return NIL; 429 } else if (first instanceof WeakHashTable) { 430 return ((WeakHashTable)first).getWeakness(); 431 } 432 return error(new TypeError(first, Symbol.HASH_TABLE)); 433 } 434 }; 435 415 436 protected static HashTable checkHashTable(LispObject ht) { 416 437 if (ht instanceof HashTable) return (HashTable)ht; -
trunk/abcl/src/org/armedbear/lisp/Symbol.java
r13273 r13310 3046 3046 public static final Symbol PUTHASH = 3047 3047 PACKAGE_SYS.addExternalSymbol("PUTHASH"); 3048 public static final Symbol HASH_TABLE_WEAKNESS = 3049 PACKAGE_SYS.addExternalSymbol("HASH-TABLE-WEAKNESS"); 3048 3050 public static final Symbol UNDEFINED_FUNCTION_CALLED = 3049 3051 PACKAGE_SYS.addExternalSymbol("UNDEFINED-FUNCTION-CALLED"); -
trunk/abcl/src/org/armedbear/lisp/WeakHashTable.java
r13309 r13310 46 46 import java.util.concurrent.locks.ReentrantLock; 47 47 48 49 50 51 52 48 // ??? Replace standard Hashtable when this code is working; maybe not 53 49 // because we have additional places for locking here. … … 79 75 final private ReentrantLock lock = new ReentrantLock(); 80 76 HashEntry bucketType; 77 final LispObject weakness; 81 78 82 79 private WeakHashTable(Comparator c, int size, LispObject rehashSize, … … 86 83 this.rehashThreshold = rehashThreshold; 87 84 bucketType = null; 85 this.weakness = weakness; 88 86 if (weakness.equals(Keyword.KEY)) { 89 87 bucketType = this.new HashEntryWeakKey(); … … 350 348 public Symbol getTest() { 351 349 return comparator.getTest(); 350 } 351 352 public LispObject getWeakness() { 353 return weakness; 352 354 } 353 355
Note: See TracChangeset
for help on using the changeset viewer.