From: Alexey D. <ade...@co...> - 2002-01-29 09:42:41
|
Hello, ----- pack.lisp ----- (defun target-if-desirable (read write) (declare (type tn-ref read write)) (setf (tn-ref-target read) write) (setf (tn-ref-target write) read)) ----- In the description of TN-REF it is said that linked TN-REFs must have different WRITE-Ps. I tried to insert an AVER here: (defun target-if-desirable (read write) (declare (type tn-ref read write)) (aver (eq (tn-ref-write-p read) (not (tn-ref-write-p write)))) (setf (tn-ref-target read) write) (setf (tn-ref-target write) read)) and it immediately caused errors. But the word DESIRABLE embarrasses me. Should this function link if it is "wanted" (in this case the AVER is right and there is a bug upstream) or "wanted and possible"? In the latter case the present code is erroneous and should be written as follows: (defun target-if-desirable (read write) (declare (type tn-ref read write)) (when (eq (tn-ref-write-p read) (not (tn-ref-write-p write))) (setf (tn-ref-target read) write) (setf (tn-ref-target write) read))) -- Regards, Alexey Dejneka |