* derrida `DERRIDA` is a library for destructuring common "object-like" structures in Common Lisp. More specifically, it provides forms that act like `WITH-SLOTS` for "object-like" or "map-like" data structure. It provides forms for digging into association lists, property lists, and struct instances and CLOS class instances. ** Examples *** Property Lists #+begin_src lisp (let ((pl (list 'name \"colin\" :age 40 :|currentJob| :crumb-bum))) (with-plist (name (age :age) (job :|currentJob|)) pl (setf age (1+ age)) (format t \"~a the ~a had a birthday, and is now ~a years old~%\" name job age) pl)) #+end_src The above would print out: : colin the CRUMB-BUM had a birthday, and is now 41 years old And would return : (NAME \"colin\" :AGE 41 :|currentJob| :CRUMB-BUM)" *** Nested Property Lists #+begin_src lisp > (defvar *pl* '(:x (:a 10) :y (:b 20)) *PL* > (with-keypaths ((a :x :a) (b :y :b) (d :y :d)) *pl* (incf a) (setf d (* a b))) 220 > *pl* (:X (:A 11) :Y (:D 220 :B 20))" #+end_src *** Nested Instances #+begin_src lisp > (defclass point () ((x :initform 0) (y :initform 0))) # > (defclass in-space () ((location :initform (make-instance 'point)))) # > (defvar *thing* (make-instance 'in-space)) *THING* > (with-slot-paths ((x 'location 'x) (y 'location 'y)) *thing* (setf x 10 y -30)) -30 > (describe (slot-value *thing* 'location)) # [standard-object] Slots with :INSTANCE allocation: X = 10 Y = -30" #+end_src