home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Lib / hash.stk < prev    next >
Encoding:
Text File  |  1996-07-21  |  1.2 KB  |  34 lines

  1. ;;;;
  2. ;;;; h a s h . s t k         -- Hash table initialisation
  3. ;;;;
  4. ;;;;
  5. ;;;; Copyright ⌐ 1993-1996 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
  6. ;;;; 
  7. ;;;; Permission to use, copy, and/or distribute this software and its
  8. ;;;; documentation for any purpose and without fee is hereby granted, provided
  9. ;;;; that both the above copyright notice and this permission notice appear in
  10. ;;;; all copies and derived works.  Fees for distribution or use of this
  11. ;;;; software or derived works may only be charged with express written
  12. ;;;; permission of the copyright holder.  
  13. ;;;; This software is provided ``as is'' without express or implied warranty.
  14. ;;;;
  15. ;;;;
  16. ;;;;           Author: Erick Gallesio [eg@unice.fr]
  17. ;;;;    Creation date:  9-May-1994 11:52
  18. ;;;; Last file update: 21-Jul-1996 18:41
  19. ;;;;
  20.  
  21. (if (symbol-bound? '%init-hash)
  22.     ;; Hash table module is in the core interpreter
  23.     (%init-hash)
  24.     ;; Try to load hash table dynamically
  25.     (load (string-append "hash." *shared-suffix*)))
  26.  
  27. (define (hash-table->list h)
  28.   (unless (hash-table? h)
  29.       (error "hash-table->list: bad hash table ~S" h))
  30.   (hash-table-map h (lambda (key value)
  31.                        (cons key value))))
  32.  
  33. (provide "hash")
  34.