RosettaCodeData/Task/Associative-array-Iteration/Common-Lisp/associative-array-iteration-1.lisp
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

8 lines
285 B
Common Lisp

;; 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))