Exported the hashing functions

This commit is contained in:
jjgarcia 2008-05-29 06:48:44 +00:00
parent 79a4547523
commit 512462cecd
4 changed files with 41 additions and 0 deletions

View file

@ -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)
{

View file

@ -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}};

View file

@ -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}};

View file

@ -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);