Add recommended targets to debian/rules
[kmrcl.git] / hash.lisp
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          hash.lisp
6 ;;;; Purpose:       Hash functions for KMRCL package
7 ;;;; Programmer:    Kevin M. Rosenberg
8 ;;;; Date Started:  Apr 2000
9 ;;;;
10 ;;;; This file, part of KMRCL, is Copyright (c) 2002-2011 by Kevin M. Rosenberg
11 ;;;;
12 ;;;; KMRCL users are granted the rights to distribute and use this software
13 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
14 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
15 ;;;; *************************************************************************
16
17
18 (in-package #:kmrcl)
19
20 ;;; hashs
21
22 (defun print-hash (h &key (stream *standard-output*)
23                    key-transform-fn value-transform-fn
24                    (prefix "") (divider " -> ") (terminator "~%"))
25   (maphash #'(lambda (k v)
26                (format stream "~A~S~A~S"
27                        prefix
28                        (if key-transform-fn
29                            (funcall key-transform-fn k)
30                            k)
31                        divider
32                        (if value-transform-fn
33                            (funcall value-transform-fn v)
34                            v))
35                (when terminator (format stream terminator)))
36            h)
37   h)
38