RosettaCodeData/Task/Associative-array-Iteration/Common-Lisp/associative-array-iteration-1.lisp

9 lines
285 B
Common Lisp
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
;; iterate using dolist, destructure manually
(dolist (pair alist)
(destructuring-bind (key . value) pair
(format t "~&Key: ~a, Value: ~a." key value)))
;; iterate and destructure with loop
(loop for (key . value) in alist
do (format t "~&Key: ~a, Value: ~a." key value))