stk/Lib/hash.stk

34 lines
1.1 KiB
Plaintext

;;;;
;;;; h a s h . s t k -- Hash table initialisation
;;;;
;;;;
;;;; Copyright © 1993-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;; Permission to use, copy, modify, distribute,and license this
;;;; software and its documentation for any purpose is hereby granted,
;;;; provided that existing copyright notices are retained in all
;;;; copies and that this notice is included verbatim in any
;;;; distributions. No written agreement, license, or royalty fee is
;;;; required for any of the authorized uses.
;;;; This software is provided ``AS IS'' without express or implied
;;;; warranty.
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 9-May-1994 11:52
;;;; Last file update: 3-Sep-1999 19:52 (eg)
;;;;
(if (symbol-bound? '%init-hash)
;; Hash table module is in the core interpreter
(%init-hash)
;; Try to load hash table dynamically
(load (string-append "hash." *shared-suffix*)))
(define (hash-table->list h)
(unless (hash-table? h)
(error "hash-table->list: bad hash table ~S" h))
(hash-table-map h (lambda (key value)
(cons key value))))
(provide "hash")