diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-10 12:20:03 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-10 12:22:54 -0800 |
commit | 497cd7dee0ca67644d92eeefac277e89361d3053 (patch) | |
tree | 3ebf0bbf69c1f900a067432694bc91490086f3aa | |
parent | 64eb78436c46c1c6eecba1093a9072ff829209c4 (diff) | |
download | txr-497cd7dee0ca67644d92eeefac277e89361d3053.tar.gz txr-497cd7dee0ca67644d92eeefac277e89361d3053.tar.bz2 txr-497cd7dee0ca67644d92eeefac277e89361d3053.zip |
* eval.c (eval_init): New functions added as intrinsics.
* hash.c (hash_eql, hash_equal): New external functions.
* hash.h (hash_eql, hash_equal): Declared.
* txr.1: Sections added.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | hash.c | 10 | ||||
-rw-r--r-- | hash.h | 2 | ||||
-rw-r--r-- | txr.1 | 2 |
5 files changed, 26 insertions, 0 deletions
@@ -1,5 +1,15 @@ 2011-12-10 Kaz Kylheku <kaz@kylheku.com> + * eval.c (eval_init): New functions added as intrinsics. + + * hash.c (hash_eql, hash_equal): New external functions. + + * hash.h (hash_eql, hash_equal): Declared. + + * txr.1: Sections added. + +2011-12-10 Kaz Kylheku <kaz@kylheku.com> + * mpi-patches/add-mp-hash: Rewrote mp_hash to only hash enough low-order bit material from the bignum to fill an unsigned long. We don't need to walk the entire bignum. If the low order @@ -1180,6 +1180,8 @@ void eval_init(void) func_n2(set_hash_userdata)); reg_fun(intern(lit("hashp"), user_package), func_n1(hashp)); reg_fun(intern(lit("maphash"), user_package), func_n2(maphash)); + reg_fun(intern(lit("hash-eql"), user_package), func_n1(hash_eql)); + reg_fun(intern(lit("hash-equal"), user_package), func_n1(hash_equal)); reg_fun(intern(lit("eval"), user_package), func_n2(eval_intrinsic)); @@ -408,6 +408,16 @@ val maphash(val fun, val hash) return nil; } +val hash_eql(val obj) +{ + return num(eql_hash(obj) % NUM_MAX); +} + +val hash_equal(val obj) +{ + return num(equal_hash(obj) % NUM_MAX); +} + /* * Called from garbage collector. Hash module must process all weak tables * that were visited during the marking phase, maintained in the list @@ -40,6 +40,8 @@ val hashp(val obj); val maphash(val func, val hash); val hash_begin(val hash); val hash_next(val *iter); +val hash_eql(val obj); +val hash_equal(val obj); void hash_process_weak(void); @@ -4835,6 +4835,8 @@ The following are Lisp functions and variables built-in to TXR. .SS Function maphash +.SS Functions hash-eql and hash-equal + .SS Function eval .SS Variables *stdout*, *stdin* and *stderr* |