RosettaCodeData/Task/Associative-array-Iteration/Common-Lisp/associative-array-iteration-1.lisp
2023-07-01 13:44:08 -04: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))