CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
|
|
@ -0,0 +1,8 @@
|
|||
;; 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))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(loop for (key value) on plist :by 'cddr
|
||||
do (format t "~&Key: ~a, Value: ~a." key value))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(maphash (lambda (key value)
|
||||
(format t "~&Key: ~a, Value: ~a." key value))
|
||||
hash-table)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(loop for key being each hash-key of hash-table using (hash-value value)
|
||||
do (format t "~&Key: ~a, Value: ~a." key value))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(with-hash-table-iterator (next-entry hash-table)
|
||||
(loop
|
||||
(multiple-value-bind (nextp key value) (next-entry)
|
||||
(if (not nextp)
|
||||
(return)
|
||||
(format t "~&Key: ~a, Value: ~a." key value)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue