A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw60/CLHS/Body/f_hash_1.htm below:

CLHS: Function HASH-TABLE-COUNT

Function HASH-TABLE-COUNT

Syntax:

hash-table-count hash-table => count

Arguments and Values:

hash-table---a hash table.

count---a non-negative integer.

Description:

Returns the number of entries in the hash-table. If hash-table has just been created or newly cleared (see clrhash) the entry count is 0.

Examples:

 (setq table (make-hash-table)) =>  #<HASH-TABLE EQL 0/120 32115135>
 (hash-table-count table) =>  0
 (setf (gethash 57 table) "fifty-seven") =>  "fifty-seven"
 (hash-table-count table) =>  1
 (dotimes (i 100) (setf (gethash i table) i)) =>  NIL
 (hash-table-count table) =>  100

Side Effects: None.

Affected By:

clrhash, remhash, setf of gethash

Exceptional Situations: None.

See Also:

hash-table-size

Notes:

The following relationships are functionally correct, although in practice using hash-table-count is probably much faster:

 (hash-table-count table) == 
 (loop for value being the hash-values of table count t) == 
 (let ((total 0))
   (maphash #'(lambda (key value)
                (declare (ignore key value))
                (incf total))
            table)
   total)

Copyright 1996-2005, LispWorks Ltd. All rights reserved.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4