MAPHASH
; Changes each entry in THE-HASH-TABLE,
; replacing each positive value with its
; square root, and removing negative values.
(maphash ; Steele’84, p285.
#'(lambda (key value)
(if (minusp value)
(remhash key the-hash-table)
(setf (gethash key the-hash-table)
(sqrt value))))
the-hash-table)
; returns NIL
Previous slide
Back to first slide
View graphic version