[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hash-values loop keyword
- To: SHAPIRO@gmr.com
- Subject: hash-values loop keyword
- From: Steve Strassmann <email@example.com>
- Date: Wed, 22 Apr 1992 11:41:16 -0500
- Cc: info-mcl
>Date: Wed, 22 Apr 1992 09:00 EST
>MCL 2.0b1 seems to have a problem with the following loop construct.
>In particular it does not seem to recognize HASH-VALUES as the loop keywords.
>(setf ht (make-hash-table))
>(loop for i below 100 do
> (setf (gethash i ht) (random 10.0)))
>(loop for value being the hash-values of ht
> minimize value into min
> maximize value into max
> finally return (list min max))
This has been fixed since MCL2.0b1 - it works in the final release.
All you have to change is to put some extra parens around
RETURN because we're not using it as a LOOP keyword.
(loop for value being the hash-values of ht
minimize value into min
maximize value into max
finally (return (list min max)))
By the way, if you love loop macros, there's six different kinds to
choose from (mit-loop, cmu-loop, sloop, yloop, iterate, and series),
available by anonymous ftp from Mark Kantrowitz's cl-utilities archive.
Hostname: a.gp.cs.cmu.edu [220.127.116.11]
cd path: /usr/mkant/Public