Next: , Previous: , Up: srfi hash-tables   [Index]


2.29.3 Rationale

Hash tables are widely recognised as a fundamental data structure for many kinds of computational tasks. Thus far, there is no existing standard for Scheme hash tables; however, almost every non–minimal Scheme implementation provides some kind of hash table functionality.

Alas, although somewhat similar, these hash table APIs have many differences: some trivial, like the naming of certain functions; some complex, like revealing different aspects of the internal implementation to the user; some coarse, like requiring keys to be of some specific type(s); some subtle, like requiring the user to guess the size of the hash table in advance to get optimal performance. As a result, the existing hash table facilities cannot be used to write portable programs.

The primary aim of this SRFI is to establish a standard API for hash tables so that portable programs can be written that make efficient use of common hash table functionality. The SRFI resolves discrepancies that exist between the various hash table API’s with respect to naming and semantics of hash table operations. A lot of effort has been put into making the the API consistent, simple and generic. The SRFI also defines some of the most common utility routines that would otherwise need to be written and rewritten for various applications.

Incorporating this SRFI as a standard feature in Scheme implementations makes it possible to write efficient and portable programs that use hash tables.