From: Bruno H. <br...@cl...> - 2004-07-23 12:07:05
|
Sam wrote: > > (defun matrix-multiply (x y) > > (with-slots (x11 x12 x21 x22) x .....)) > > > > If the users passes a wrong object instead of a matrix, will he want > > to acknowledge 4 errors, and continue from each of them by passing a > > replacement object? No, he will want to replace the 'x' just once and > > then 'redo' the matrix-multiply invocation stack frame. > > the first assert should affect all: the replacement value should > propagate. It cannot propagate to the callers. The accessor methods that I changed, and the SLOT-VALUE function that is called by WITH-SLOTS, are _functions_. Any ASSERT in there can change local variable in that function only, not local variables upwards in the stack. > maybe WITH-SLOTS should push the check to the beginning > and then use accessors with check stripped. It cannot do so: 1. WITH-SLOTS does not know about the class. 2. For different slot names, the expected class can be different: x11 could be valid on both classes MATRIX-1-1 and MATRIX-2-2, whereas x12 is only valid on MATRIX-2-2. > > So I consider it much more important to work on a general 'redo'/'return' > > facility than on low-level continue everywhere. > > For example using your approach from 2004-04-21. > > are you working on that? I'm working on the items in the TODO list for the moment. You have plenty of time for working on 'redo'/'return'. Bruno |