Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
You can edit this page using
wiki syntax
for markup.
Article contents:
[[tags: egg]] [[toc:]] == srfi-125 This egg '''CANNOT''' coexist with [[srfi-69-weak|srfi-69-weak]]. Uninstall it before installing this egg. An implementation of SRFI 125 with SRFI 90 extensions. For more information, see [[http://srfi.schemers.org/srfi-125/srfi-125.html|SRFI-125]] and [[http://srfi.schemers.org/srfi-90/srfi-90.html|SRFI-90]]. Only the deviations from the SRFI are documented below, otherwise follow [[http://srfi.schemers.org/srfi-125/srfi-125.html|SRFI-125]]. * Deviations from the sample implementation. but not the SRFI: ; ''immutable copy'' : A {{hash-table}} is always {{mutable?}}. ; ''duplicate keys'' : Allowed in {{alist}} & {{plist}} contexts; LIFO rules. === Usage * Provides the SRFI 125 API; from {{(srfi 125 weak var)}}, {{(srfi 69 hash)}}, and {{(srfi 125 introspection)}}. <enscript language=scheme> (import (srfi 125)) </enscript> * Weakness unsupported <enscript language=scheme> (import (srfi 69 hash) (srfi 125 strong)) </enscript> * Weakness w/ space vs time - variable reference size: 1 - 2 cons cells <enscript language=scheme> (import (srfi 69 hash) (srfi 125 weak var)) </enscript> * Weakness w/ time vs space - fixed reference size: 2 cons cells <enscript language=scheme> (import (srfi 69 hash) (srfi 125 weak fix)) </enscript> * Stuff you shouldn't know <enscript language=scheme> (import (srfi 125 introspection)) </enscript> === Hash Table Procedures ==== make-hash-table <procedure>(make-hash-table [COMPARATOR | TEST [HASH]] [SIZE] ['weak-keys] ['weak-values] [#:test TEST] [#:hash HASH] [#:size SIZE] [#:initial INITIAL] [#:min-load MIN-LOAD] [#:max-load MAX-LOAD] [#:weak-keys WEAK-KEYS] [#:weak-values WEAK-VALUES])</procedure> Returns a new {{HASH-TABLE}} with the supplied configuration. ; {{COMPARATOR}} : {{<comparator>}} ; {{(srfi 128)}} comparator. ; {{TEST}} : {{(* * -> *)}} ; equivalence function. ; {{HASH}} : {{(* [fixnum ...] -> fixnum)}} ; hash function. ; {{SIZE}} : {{fixnum}} ; expected number of table elements. ; {{INITIAL}} : {{*}} ; default initial value. ; {{MIN-LOAD}} : {{flonum(0.0 1.0)}} ; minimum load factor. ; {{MAX-LOAD}} : {{flonum(0.0 1.0)}} ; maximum load factor. ; {{WEAK-KEYS}} : {{boolean}} ; weak references for keys. ; {{WEAK-VALUES}} : {{boolean}} ; weak references for values. Please note that hash tables are ''not'' guaranteed to compare {{equal?}} to each other, even if they contain exactly the same key/value pairs. ==== hash-table-size-limit <procedure>(hash-table-size-limit HASH-TABLE)</procedure> The {{HASH-TABLE}} size-limit. The returned exact non-negative integer is the count of associations in a table that holds data strongly, or at least did. Weak tables may have dropped entries that will not be scavenged until a {{hash-table-clean!}} therefore a ''limit''. An O(1) operation. ==== hash-table-equivalence-function <procedure>(hash-table-equivalence-function HASH-TABLE)</procedure> The {{HASH-TABLE}} {{equivalence-function}}. ==== hash-table-min-load <procedure>(hash-table-min-load HASH-TABLE)</procedure> The {{HASH-TABLE}} minimum load factor. ==== hash-table-max-load <procedure>(hash-table-max-load HASH-TABLE)</procedure> The {{HASH-TABLE}} maximum load factor. ==== hash-table-weak-keys <procedure>(hash-table-weak-keys HASH-TABLE)</procedure> Does the {{HASH-TABLE}} use weak references for keys? ==== hash-table-weak-values <procedure>(hash-table-weak-values HASH-TABLE)</procedure> Does the {{HASH-TABLE}} use weak references for values? ==== hash-table-mutable? <procedure>(hash-table-mutable? HASH-TABLE)</procedure> Always returns {{#t}}. ==== hash-table-ephemeral-keys ==== hash-table-ephemeral-values <procedure>(hash-table-ephemeral-keys HASH-TABLE)</procedure> <procedure>(hash-table-ephemeral-values HASH-TABLE)</procedure> Always returns {{#f}}. ==== hash-table-has-initial? <procedure>(hash-table-has-initial? HASH-TABLE)</procedure> Does the {{HASH-TABLE}} have a default initial value? ==== hash-table-initial <procedure>(hash-table-initial HASH-TABLE)</procedure> The {{HASH-TABLE}} default initial value. ==== hash-table-key-vector <procedure>(hash-table-key-vector HASH-TABLE)</procedure> Returns a {{vector}} of the keys in the {{HASH-TABLE}} population. ==== hash-table-value-vector <procedure>(hash-table-value-vector HASH-TABLE)</procedure> Returns a {{vector}} of the values in the {{HASH-TABLE}} population. ==== hash-table-entries <procedure>(hash-table-entries HASH-TABLE)</procedure> Returns the keys and values lists as values. ==== hash-table-vectors <procedure>(hash-table-vectors HASH-TABLE)</procedure> Returns the keys and values vectors as values. ==== hash-table->plist <procedure>(hash-table->plist HASH-TABLE)</procedure> Returns the population of the {{HASH-TABLE}} as a {{property-list}}. ==== hash-table-clean! <procedure>(hash-table-clean! HASH-TABLE)</procedure> Scavenges any broken weak entries in {{HASH-TABLE}}. === Hashing Functions ==== Usage <enscript language=scheme> (import (srfi 69 hash)) </enscript> A larger set of hashing functions are available, beyond the four mandated by the SRFI. Please refer to the [[srfi-69|SRFI 69]] egg documentation. === Author Felix, Kon, The CHICKEN Team. === Repository This egg is hosted on the CHICKEN Subversion repository: [[https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/srfi-125|https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/srfi-125]] If you want to check out the source code repository of this egg and you are not familiar with Subversion, see [[/egg-svn-checkout|this page]]. === Requirements [[srfi-69]] [[srfi-128]] [[test]] [[test-utils]] === Version History ; 0.0.9 : Remove minor {{hash-table-set!}} overhead. ; 0.0.8 : Fix tested property function names. ; 0.0.7 : The {{srfi-69}} provides hash functions. Remove the trailing ''?'' from property functions. The {{(srfi 125)}} types reference the module. ; 0.0.6 : Fix type references. Fix {{hash-table-update!}}. Fix {{hash-table-mutable?}}, etc. result. ; 0.0.5 : Remove duplicate checks. ; 0.0.4 : Speedup {{hash-table-pop!}}. ; 0.0.3 : Proper reexport. ; 0.0.2 : Slimming. ; 0.0.1 : CHICKEN 6 release. === License Copyright (c) 2008-2021, The Chicken Team Copyright (c) 2000-2007, Felix L. Winkelmann All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 5 by 9?