Nala Ginrut <nalagin...@gmail.com> skribis:

> * hash-items: get the amount of items in the hash table

There’s already ‘hash-count’, recently added.

> +SCM_DEFINE (scm_hash_size, "hash-size", 1, 0, 0,
> +            (SCM table),
> +            "Get the size of this hash table.")
> +#define FUNC_NAME s_scm_hash_size
> +{
> +  SCM_VALIDATE_HASHTABLE (1, table);
> +  return scm_from_uint (SCM_SIMPLE_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR 
> (table)));

That returns the number of buckets, which is an internal detail, and
probably not a useful one.

> +(define (hash-keys table)
> +  "Return all the keys from hash table."
> +  (hash-map->list (lambda (x y) x) table))

That doesn’t seem sufficiently common to warrant a new procedure.  WDYT?

Thanks,
Ludo’.


Reply via email to