[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question regarding maphash
- To: clisp-list@[129.13.115.2]
- Subject: Re: question regarding maphash
- From: hoehle@inf-wiss.uni-konstanz.de (Joerg-Cyril Hoehle)
- Date: Thu, 29 Jun 95 08:48:22 +0200
Dan Stanger wrote:
> (defun maph (f s) (maphash f s))
> (setf h (make-hash-table))
> (setf (gethash 1 h) 'a)
> (setf (gethash 2 h) 'b)
> (print h)
>
> (maph #'(lambda (a) (print a)) h)
> *** - EVAL/APPLY: too many arguments given to :LAMBDA
Maphash uses a function with two arguments, the first being the hash
key, the second the value. Your lambda only has one parameter.
(maph #'(lambda (k v) (format t "~&~S ~S~%" k v)) h) should work.
Joerg Hoehle
hoehle@inf-wiss.uni-konstanz.de