diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-21 11:12:20 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-21 11:12:20 -0800 |
commit | 4a1556a848c5bfb527cecb2b823a750ba63e6f80 (patch) | |
tree | be9378666222056692e4770a8f0eb79b45ef8993 /hash.c | |
parent | 00f823aee439ed8c2cdd71dfbb89385dc68eae7b (diff) | |
download | txr-4a1556a848c5bfb527cecb2b823a750ba63e6f80.tar.gz txr-4a1556a848c5bfb527cecb2b823a750ba63e6f80.tar.bz2 txr-4a1556a848c5bfb527cecb2b823a750ba63e6f80.zip |
Introducing symbol packages. Internal symbols are now in
a system package instead of being hacked with the $ prefix.
Keyword symbols are provided. In the matcher, evaluation
is tightened up. Keywords, nil and t are not bindeable, and
errors are thrown if attempts are made to bind them.
Destructuring in dest_bind is strict in the number of items.
String streams are exploited to print bindings to objects
that are not strings or characters. Numerous bugfixes.
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -93,6 +93,7 @@ static long ll_hash(val obj) case NUM: return c_num(obj) & NUM_MAX; case SYM: + case PKG: return ((long) obj) & NUM_MAX; case FUN: return ((long) obj->f.f.interp_fun + ll_hash(obj->f.env)) & NUM_MAX; @@ -238,12 +239,12 @@ val make_hash(val weak_keys, val weak_vals) return hash; } -val *gethash_l(val hash, val key) +val *gethash_l(val hash, val key, val *new_p) { struct hash *h = (struct hash *) hash->co.handle; val *pchain = vecref_l(h->table, num(ll_hash(key) % h->modulus)); val old = *pchain; - val *place = acons_new_l(pchain, key); + val *place = acons_new_l(pchain, key, new_p); if (old != *pchain && ++h->count > 2 * h->modulus) hash_grow(h); return place; |