Additional dolist style macros for Common Lisp. Currently provides doalist
, dohash
, dolist*
, doplist
, doseq
and doseq*
.
Iterates over the key value pairs of an alist.
(doalist (key value alist &optional return-form)
(format t "key: ~A, value: ~A~%" key value))
Iterates over the key value pairs of a hash table.
(dohash (key value hash-table &optional return-form)
(format t "key: ~A, value: ~A~%" key value))
Iterates over a list with a position variable tracking the current index.
(dolist* (position value list &optional return-form)
(format t "position: ~A, value: ~A~%" position value))
Iterates over the key value pairs of an plist.
(doplist (key value plist &optional return-form)
(format t "key: ~A, value: ~A~%" key value))
Iterates over the values of a sequence.
(doseq (value sequence &optional return-form)
(format t "value: ~A~%" position value))
Iterates over a sequence with a position variable tracking the current index.
(doseq* (position value sequence &optional return-form)
(format t "position: ~A, value: ~A~%" position value))