1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/f_invo_2.htm
2024-04-01 10:24:07 +02:00

77 lines
5.9 KiB
HTML

<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Function INVOKE-RESTART-INTERACTIVELY</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="f_invo_1.htm">
<LINK REL=UP HREF="c_condit.htm">
<LINK REL=NEXT HREF="m_rst_bi.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="f_invo_1.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_condit.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="m_rst_bi.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<A NAME="invoke-restart-interactively"><I>Function</I> <B>INVOKE-RESTART-INTERACTIVELY</B></A> <P>
<P><B>Syntax:</B><P>
<P>
<B>invoke-restart-interactively</B> <I>restart</I> =&gt; <I><I>result</I><B>*</B></I><P>
<P>
<P><B>Arguments and Values:</B><P>
<P>
<I>restart</I>---a <A REL=DEFINITION HREF="26_glo_r.htm#restart_designator"><I>restart designator</I></A>. <P>
<I>results</I>---the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>values</I></A> returned by the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> associated with <I>restart</I>, if that <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> returns. <P>
<P><B>Description:</B><P>
<P>
<A REL=DEFINITION HREF="#invoke-restart-interactively"><B>invoke-restart-interactively</B></A> calls the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> associated with <I>restart</I>, prompting for any necessary arguments. If <I>restart</I> is a name, it must be valid in the current <A REL=DEFINITION HREF="26_glo_d.htm#dynamic_environment"><I>dynamic environment</I></A>. <P>
<A REL=DEFINITION HREF="#invoke-restart-interactively"><B>invoke-restart-interactively</B></A> prompts for arguments by executing the code provided in the <TT>:interactive</TT> keyword to <A REL=DEFINITION HREF="m_rst_ca.htm#restart-case"><B>restart-case</B></A> or <TT>:interactive-function</TT> keyword to <A REL=DEFINITION HREF="m_rst_bi.htm#restart-bind"><B>restart-bind</B></A>. <P>
If no such options have been supplied in the corresponding <A REL=DEFINITION HREF="m_rst_bi.htm#restart-bind"><B>restart-bind</B></A> or <A REL=DEFINITION HREF="m_rst_ca.htm#restart-case"><B>restart-case</B></A>, then the consequences are undefined if the <I>restart</I> takes required arguments. If the arguments are optional, an argument list of <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A> is used. <P>
Once the arguments have been determined, <A REL=DEFINITION HREF="#invoke-restart-interactively"><B>invoke-restart-interactively</B></A> executes the following: <P>
<PRE>
(apply #'invoke-restart restart arguments)
</PRE>
</TT> <P>
<P><B>Examples:</B><P>
<P>
<PRE>
(defun add3 (x) (check-type x number) (+ x 3))
(add3 'seven)
&gt;&gt; Error: The value SEVEN was not of type NUMBER.
&gt;&gt; To continue, type :CONTINUE followed by an option number:
&gt;&gt; 1: Specify a different value to use.
&gt;&gt; 2: Return to Lisp Toplevel.
&gt;&gt; Debug&gt; (invoke-restart-interactively 'store-value)
&gt;&gt; Type a form to evaluate and use: 7
=&gt; 10
</PRE>
</TT> <P>
<P><B>Side Effects:</B><P>
<P>
If prompting for arguments is necesary, some typeout may occur (on <A REL=DEFINITION HREF="26_glo_q.htm#query_iSLo"><I>query I/O</I></A>). <P>
A non-local transfer of control might be done by the restart. <P>
<P><B>Affected By:</B><P>
<P>
<A REL=DEFINITION HREF="v_debug_.htm#STquery-ioST"><B>*query-io*</B></A>, active <A REL=DEFINITION HREF="26_glo_r.htm#restart"><I>restarts</I></A> <P>
<P><B>Exceptional Situations:</B><P>
<P>
If <I>restart</I> is not valid, an error of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_contro.htm#control-error"><B>control-error</B></A> is signaled. <P>
<P><B>See Also:</B><P>
<P>
<A REL=DEFINITION HREF="f_find_r.htm#find-restart"><B>find-restart</B></A>, <A REL=DEFINITION HREF="f_invo_1.htm#invoke-restart"><B>invoke-restart</B></A>, <A REL=DEFINITION HREF="m_rst_ca.htm#restart-case"><B>restart-case</B></A>, <A REL=DEFINITION HREF="m_rst_bi.htm#restart-bind"><B>restart-bind</B></A> <P>
<P><B>Notes:</B><P>
<P>
<A REL=DEFINITION HREF="#invoke-restart-interactively"><B>invoke-restart-interactively</B></A> is used internally by the debugger and may also be useful in implementing other portable, interactive debugging tools. <P>
<HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>