gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Two four liners for ANSI


From: Camm Maguire
Subject: [Gcl-devel] Re: Two four liners for ANSI
Date: 09 Aug 2005 01:32:05 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings and thanks!  In cvs head, past t4 -- thanks again!

Take care,

Robert Boyer <address@hidden> writes:

> Below are two definitions of two new functions for GCL ANSI Common Lisp
> compliance.  They should be added to o/hash.d, right after the definition of
> "HASH-TABLE-SIZE".  Both of these functions are absent from the CLTL1 GCL.
> 
> DEFUN_NEW("HASH-TABLE-REHASH-SIZE",object,fLhash_table_rehash_size,LISP,1,1,NONE,OO,OO,OO,OO,(object
>  table),"")
> {
>   check_type_hash_table(&table);
>   RETURN1(table->ht.ht_rhsize);
> }
> 
> DEFUN_NEW("HASH-TABLE-REHASH-THRESHOLD",object,fLhash_table_rehash_threshold,LISP,1,1,NONE,OO,OO,OO,OO,(object
>  table),"")
> {
>   check_type_hash_table(&table);
>   RETURN1(table->ht.ht_rhthresh);
> }
> 
> Bob and Warren
> 
> -------------------------------------------------------------------------------
> 
> P. S. Here, for ease of reference, is the ANSI documentation on
> HASH-TABLE-[SIZE,REHASH-THRESHOLD,REHASH-SIZE].
> 
> \begincom{hash-table-rehash-size} Function
> 
> \issue{HASH-TABLE-ACCESS:X3J13-MAR-89}
> 
> Syntax::
> 
> \DefunWithValues hash-table-rehash-size {hash-table} {rehash-size}
> 
> Arguments and Values::
> 
> hash-table---a hash table.
> 
> rehash-size---a real of type (or (integer 1 *) (float (1.0) *)).
> 
> Description::
> 
> Returns the current rehash size of hash-table, suitable for use in a call to
> make-hash-table in order to produce a hash table with state corresponding to
> the current state of the hash-table.
> 
> Examples::
> 
> 
>  (setq table (make-hash-table :size 100 :rehash-size 1.4))
> => #<HASH-TABLE EQL 0/100 2556371>
> 
>  GCL does not yet implement the function hash-table-rehash-size.
> 
>  (hash-table-rehash-size table) => 1.4
> 
> 
> Side Effects:  None.
> 
> Affected By:  None.
> 
> Exceptional Situations::
> 
> \Shouldchecktype{hash-table}{a hash table}
> 
> See Also::
> 
> make-hash-table, hash-table-rehash-threshold
> 
> Notes::
> 
> \issue{HASH-TABLE-REHASH-SIZE-INTEGER}
> If the hash table was created with an integer rehash size, the result is an
> integer, indicating that the rate of growth of the hash-table when rehashed
> is intended to be additive; otherwise, the result is a float, indicating that
> the rate of growth of the hash-table when rehashed is intended to be
> multiplicative.  However, this value is only advice to the implementation;
> the actual amount by which the hash-table will grow upon rehash is
> implementation-dependent.
> \endissue{HASH-TABLE-REHASH-SIZE-INTEGER}
> 
> \endissue{HASH-TABLE-ACCESS:X3J13-MAR-89}
> \endcom
> 
> 
> %%% ========== HASH-TABLE-REHASH-THRESHOLD
> \begincom{hash-table-rehash-threshold} Function
> 
> \issue{HASH-TABLE-ACCESS:X3J13-MAR-89}
> 
> Syntax::
> 
> \DefunWithValues hash-table-rehash-threshold {hash-table} {rehash-threshold}
> 
> Arguments and Values::
> 
> hash-table---a hash table.
> 
> \issue{HASH-TABLE-SIZE:INTENDED-ENTRIES}
> rehash-threshold---a real of type (real 0 1).
> % KMP thinks HASH-TABLE-SIZE:INTENDED-ENTRIES implies this can no longer be
> % an integer. Moon concurs.
> \endissue{HASH-TABLE-SIZE:INTENDED-ENTRIES}
> 
> Description::
> 
> Returns the current rehash threshold of hash-table, which is suitable for use
> in a call to make-hash-table in order to produce a hash table with state
> corresponding to the current state of the hash-table.
> 
> Examples::
> 
> 
>  (setq table (make-hash-table :size 100 :rehash-threshold 0.5))
> => #<HASH-TABLE EQL 0/100 2562446>
> 
>  GCL does not yet have a definition for hash-table-rehash-threshold table:
>  (hash-table-rehash-threshold table) => 0.5
> 
> 
> Side Effects:  None.
> 
> Affected By:  None.
> 
> Exceptional Situations::
> 
> \Shouldchecktype{hash-table}{a hash table}
> 
> See Also::
> 
> make-hash-table, hash-table-rehash-size
> 
> %% Per X3J13. -kmp 05-Oct-93
> Notes:  None.
> 
> \endissue{HASH-TABLE-ACCESS:X3J13-MAR-89}
> 
> \endcom
> 
> 
> %%% ========== HASH-TABLE-SIZE
> \begincom{hash-table-size} Function
> 
> \issue{HASH-TABLE-ACCESS:X3J13-MAR-89}
> 
> Syntax::
> 
> \DefunWithValues hash-table-size {hash-table} {size}
> 
> Arguments and Values::
> 
> hash-table---a hash table.
> 
> size---a non-negative integer.
> 
> Description::
> 
> Returns the current size of hash-table, which is suitable for use in a call
> to make-hash-table in order to produce a hash table with state corresponding
> to the current state of the hash-table.
> 
> Examples:  None.
> 
> Side Effects:  None.
> 
> Affected By:  None.
> 
> Exceptional Situations::
> 
> \Shouldchecktype{hash-table}{a hash table}
> 
> See Also::
> 
> hash-table-count, make-hash-table
> 
> %% Per X3J13. -kmp 05-Oct-93
> Notes:  None.
> 
> \endissue{HASH-TABLE-ACCESS:X3J13-MAR-89}
> 
> \endcom
> 
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]