;"Right-thinking" way to set a field in an alist
;Strategy:
;  1. Cruise down alist, looking for a pair starting with field-name.
;  2. As we go, we're building a new alist of each pair that we examine.
;  3. If we get to pair that does start with field-name, we make a new
;     pair with the value of the parmameter sent in, glue on the rest of
;     the alist and we're done.
;  4. Otherwise we glue in the pair we just examined as is and continue
;     looking down the rest of the list, until we get to the end (signaled
;     by a null list).
(defun setfield (field-name value struct)
    (cond ( (null struct) nil )
	  ( (eq field-name (caar struct) )
	    (cons (cons (caar struct) (list value)) (cdr struct)) )
	  ( t (cons (car struct) (setfield field-name value (cdr struct))) )
    )
)


;"Wrong-thinking" way to set a field in an struct
(defun dsetfield (field-name value struct)
    (setf (cdr (assoc field-name struct)) (list value))
)