Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: do-proplist/collecting , Previous: differentiate , Up: D , Home: Overview

Clamps Dictionary

do-proplist

Macro

(do-proplist (keysym valuesym) proplist &body body)

Like dolist but traversing a property list. All keys and values of proplist are bound to the symbols keysym and valuesym in the lexical scope of body.

Arguments

keysym Symbol bound to all keys of the property list.
valuesym Symbol bound to all values of the property list.
proplist Property list to be traversed.

Examples

(do-proplist (key value) '(a 1 b 2 c 3 d 4)
  (format t "key: ~a, value: ~a~%" key value)) ;  => nil

;; Output in REPL:
;;
;; key: a, value: 1
;; key: b, value: 2
;; key: c, value: 3
;; key: d, value: 4

(let ((proplist '(a 1 b 2 c 3 d 4)))
  (do-proplist (key value) proplist
    (setf (getf proplist key) (incf value 10)))
  proplist)
;; => (a 11 b 12 c 13 d 14)

Author: Orm Finnendahl

Created: 2025-02-18 Di 12:58

Validate