diff --git a/src/c/hash.d b/src/c/hash.d index 479beb04a..73267711d 100644 --- a/src/c/hash.d +++ b/src/c/hash.d @@ -613,6 +613,36 @@ cl_sxhash(cl_object key) @(return MAKE_FIXNUM(output & mask)) } +@(defun si::hash-eql (&rest args) + cl_index h; +@ + for (h = 0; narg; narg--) { + cl_object o = cl_va_arg(args); + h = _hash_eql(h, o); + } + @(return MAKE_FIXNUM(h)) +@) + +@(defun si::hash-equal (&rest args) + cl_index h; +@ + for (h = 0; narg; narg--) { + cl_object o = cl_va_arg(args); + h = _hash_equal(0, h, o); + } + @(return MAKE_FIXNUM(h)) +@) + +@(defun si::hash-equalp (&rest args) + cl_index h; +@ + for (h = 0; narg; narg--) { + cl_object o = cl_va_arg(args); + h = _hash_equalp(0, h, o); + } + @(return MAKE_FIXNUM(h)) +@) + cl_object cl_maphash(cl_object fun, cl_object ht) { diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h index a4c66a8f9..1c656428d 100644 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -1699,5 +1699,9 @@ cl_symbols[] = { {SYS_ "BYTECODES", SI_ORDINARY, NULL, 1, OBJNULL}, +{SYS_ "HASH-EQL", SI_ORDINARY, si_hash_eql, -1, OBJNULL}, +{SYS_ "HASH-EQUAL", SI_ORDINARY, si_hash_equal, -1, OBJNULL}, +{SYS_ "HASH-EQUALP", SI_ORDINARY, si_hash_equalp, -1, OBJNULL}, + /* Tag for end of list */ {NULL, CL_ORDINARY, NULL, -1, OBJNULL}}; diff --git a/src/c/symbols_list2.h b/src/c/symbols_list2.h index 962c73fc1..50cd2ce46 100644 --- a/src/c/symbols_list2.h +++ b/src/c/symbols_list2.h @@ -1699,5 +1699,9 @@ cl_symbols[] = { {SYS_ "BYTECODES",NULL}, +{SYS_ "HASH-EQL","si_hash_eql"}, +{SYS_ "HASH-EQUAL","si_hash_equal"}, +{SYS_ "HASH-EQUALP","si_hash_equalp"}, + /* Tag for end of list */ {NULL,NULL}}; diff --git a/src/h/external.h b/src/h/external.h index fb6069e10..df517310c 100644 --- a/src/h/external.h +++ b/src/h/external.h @@ -678,6 +678,9 @@ extern ECL_API cl_object si_hash_table_iterator(cl_object ht); extern ECL_API cl_object cl_make_hash_table _ARGS((cl_narg narg, ...)); extern ECL_API cl_object cl_gethash _ARGS((cl_narg narg, cl_object key, cl_object ht, ...)); extern ECL_API cl_object si_copy_hash_table(cl_object orig); +extern ECL_API cl_object si_hash_eql _ARGS((cl_narg narg, ...)); +extern ECL_API cl_object si_hash_equal _ARGS((cl_narg narg, ...)); +extern ECL_API cl_object si_hash_equalp _ARGS((cl_narg narg, ...)); extern ECL_API void ecl_sethash(cl_object key, cl_object hashtable, cl_object value); extern ECL_API cl_object ecl_gethash(cl_object key, cl_object hash);