|
From: Hoehle, Joerg-C. <Joe...@t-...> - 2005-08-02 09:21:15
|
Hi, several times I've been bitten by EXT:LETF, which generally sounds like = a useful macro. It does something like (unwind-protect (setf place value) body (setf = place original-value)) However, it does not correctly restore the original state when used = with GETHASH or SYMBOL-VALUE. Both places are set to NIL at exit, = whereas they might have been unset/unbound before. [27]> (let ((h(make-hash-table)))(ext:letf (((gethash 'a h) 'b))1)h) #S(HASH-TABLE :TEST FASTHASH-EQL (A . NIL)) ; expected empty hash table Furthermore, (ext:letf (((symbol-value 'a) 3)) a) errors out when a is = not bound prior to entering the form. A consistent integration of LETF with places would restore the boundp = state. Hmm, the same argument would apply to struct slots... The current behaviour is very close to a bug, wouldn't you think? Regards, J=F6rg H=F6hle. |