Subject: Re: (setf (getf ... and list of plists
From: (Rob Warnock)
Date: Sat, 28 Jul 2007 03:18:15 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Kent M Pitman  <> wrote:
| [(SETF (GETF ...) ...) is ] approximately defined [it doesn't do it
| this way, but it will be easiest to understand this way, I think] as:
|  (defmacro setf-of-getf (place indicator value) ;APPROXIMATE ONLY
|    `(let ((place-value ,place)
|           (indicator ,indicator)
|           (value ,value))
|       (loop for (ind . tail) on place-value
|             when (eq ind indicator)
|               do (return (setf (car tail) value))
|             finally 
|               (progn (setf ,place (list* indicator value place-value))))))

Uh... shouldn't that LOOP/FOR clause have a BY #'CDDR on it? That is:

        (loop for (ind . tail) on place-value by #'cddr
	      when (eq ind indicator)
	      ... )

Yes, I know you said "APPROXIMATE ONLY", but if he tries to manually
walk it through, OP might get confused without the BY #'CDDR.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607