<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 21 Jun 2010, at 22:29, Daniel Weinreb wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">But what if the test function isn't called at all, because<br>the program called find-restart, compute-restart, or<br>invoke-restart without passing any condition argument?</span></blockquote></div><br><div>The test should still be called then, but with an argument of NIL.  From FIND-RESTART:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>If <i>identifier</i> is a <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#symbol"><i>symbol</i></a>,
 then the innermost (most recently established) <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#applicable_restart"><i>applicable
 restart</i></a> with that <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_n.htm#name"><i>name</i></a>
 is returned. <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/a_nil.htm#nil"><b>nil</b></a>
 is returned if no such restart is found. </div></blockquote><br><div>And from the definition of "applicable restart":</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>2. (for no particular <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#condition"><i>condition</i></a>)
 an <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#active"><i>active</i></a>
 <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_h.htm#handler"><i>handler</i></a>
 for which the associated test returns <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_t.htm#true"><i>true</i></a>
 when given <a rel="DEFINITION" href="http://www.lispworks.com/documentation/HyperSpec/Body/a_nil.htm#nil"><b>nil</b></a>
 as an argument.</div></blockquote><div><br></div>As far as I can see, the situation is reasonably clear: if FOO has a test which returns NIL when given NIL as an argument, then (FIND-RESTART 'FOO) should return NIL.  The problem seems to be, I think, whether INVOKE-RESTART should cause the test to be run as well, and I think the answer ought to be as follows.<div><br></div><div>I think (INVOKE-RESTART 'FOO) is essentially (INVOKE-RESTART (FIND-RESTART 'FOO)_ which is essentially (from above) (INVOKE-RESTART (FIND-RESTART 'FOO NIL)).  So in that case, INVOKE-RESTART will (indirectly) call the test, with NIL as its argument.<div><br></div><div>But if <i>have</i> a restart object (not just a symbol which may or may not name one), then I think INVOKE-RESTART should just get on and run it: it's too late now to run the test.  This allows the possibility of getting hold of a restart under false pretences, but I think that's something one can not avoid.</div></div><div><br></div><div>As I understand it that's what Kent Pitman is saying in the mail quoted previously, and I think that is right.</div><div><br></div><div>This is not the behaviour that CCL has: INVOKE-RESTART calls the test, regardless of whether you call it with a restart object, or a symbol naming one.  I think that's wrong (though this is obviously just my opinion).</div><div><br></div><div>It seems to me that this issue is getting confused because, in some of the earlier examples posted here, what was being done was (INVOKE-RESTART <symbol-naming-restart>), and I think in that case (from above) that the test <i>should</i> be invoked, as the restart is looked up (in other words, if I just have a name, I don't have a restart yet).</div><div><br></div><div>However I have not followed this really carefully, or thought about it enough.</div><div><br></div><div>--tim</div></body></html>