83 lines
6.5 KiB
HTML
83 lines
6.5 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 BREAK</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_invoke.htm">
|
|
<LINK REL=UP HREF="c_condit.htm">
|
|
<LINK REL=NEXT HREF="v_debugg.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_invoke.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="v_debugg.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<A NAME="break"><I>Function</I> <B>BREAK</B></A> <P>
|
|
<P><B>Syntax:</B><P>
|
|
<P>
|
|
|
|
<B>break</B> <I><TT>&optional</TT> format-control <TT>&rest</TT> format-arguments</I> => <I><A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A></I><P>
|
|
<P>
|
|
<P><B>Arguments and Values:</B><P>
|
|
<P>
|
|
<I>format-control</I>---a <A REL=DEFINITION HREF="26_glo_f.htm#format_control"><I>format control</I></A>. The default is <A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A>. <P>
|
|
<I>format-arguments</I>---<A REL=DEFINITION HREF="26_glo_f.htm#format_argument"><I>format arguments</I></A> for the <I>format-control</I>. <P>
|
|
<P><B>Description:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="#break"><B>break</B></A> <A REL=DEFINITION HREF="26_glo_f.htm#format"><I>formats</I></A> <I>format-control</I> and <I>format-arguments</I> and then goes directly into the debugger without allowing any possibility of interception by programmed error-handling facilities. <P>
|
|
If the <A REL=DEFINITION HREF="a_contin.htm#continue"><B>continue</B></A> <A REL=DEFINITION HREF="26_glo_r.htm#restart"><I>restart</I></A> is used while in the debugger, <A REL=DEFINITION HREF="#break"><B>break</B></A> immediately returns <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A> without taking any unusual recovery action. <P>
|
|
<A REL=DEFINITION HREF="#break"><B>break</B></A> binds <A REL=DEFINITION HREF="v_debugg.htm#STdebugger-hookST"><B>*debugger-hook*</B></A> to <A REL=DEFINITION HREF="a_nil.htm#nil"><B>nil</B></A> before attempting to enter the debugger. <P>
|
|
<P><B>Examples:</B><P>
|
|
<P>
|
|
<PRE>
|
|
(break "You got here with arguments: ~:S." '(FOO 37 A))
|
|
>> BREAK: You got here with these arguments: FOO, 37, A.
|
|
>> To continue, type :CONTINUE followed by an option number:
|
|
>> 1: Return from BREAK.
|
|
>> 2: Top level.
|
|
>> Debug> :CONTINUE 1
|
|
>> Return from BREAK.
|
|
=> NIL
|
|
|
|
</PRE>
|
|
</TT> <P>
|
|
<P><B>Side Effects:</B><P>
|
|
<P>
|
|
The debugger is entered. <P>
|
|
<P><B>Affected By:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="v_debug_.htm#STdebug-ioST"><B>*debug-io*</B></A>. <P>
|
|
<P><B>Exceptional Situations:</B> None.
|
|
<P>
|
|
<P><B>See Also:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="f_error.htm#error"><B>error</B></A>, <A REL=DEFINITION HREF="f_invoke.htm#invoke-debugger"><B>invoke-debugger</B></A>. <P>
|
|
<P><B>Notes:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="#break"><B>break</B></A> is used as a way of inserting temporary debugging ``breakpoints'' in a program, not as a way of signaling errors. For this reason, <A REL=DEFINITION HREF="#break"><B>break</B></A> does not take the <I>continue-format-control</I> <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> that <A REL=DEFINITION HREF="f_cerror.htm#cerror"><B>cerror</B></A> takes. This and the lack of any possibility of interception by <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> <I>handling</I> are the only program-visible differences between <A REL=DEFINITION HREF="#break"><B>break</B></A> and <A REL=DEFINITION HREF="f_cerror.htm#cerror"><B>cerror</B></A>. <P>
|
|
The user interface aspects of <A REL=DEFINITION HREF="#break"><B>break</B></A> and <A REL=DEFINITION HREF="f_cerror.htm#cerror"><B>cerror</B></A> are permitted to vary more widely, in order to accomodate the interface needs of the <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A>. For example, it is permissible for a <A REL=DEFINITION HREF="26_glo_l.htm#lisp_read-eval-print_loop"><I>Lisp read-eval-print loop</I></A> to be entered by <A REL=DEFINITION HREF="#break"><B>break</B></A> rather than the conventional debugger. <P>
|
|
<A REL=DEFINITION HREF="#break"><B>break</B></A> could be defined by: <P>
|
|
|
|
<PRE>
|
|
(defun break (&optional (format-control "Break") &rest format-arguments)
|
|
(with-simple-restart (continue "Return from BREAK.")
|
|
(let ((*debugger-hook* nil))
|
|
(invoke-debugger
|
|
(make-condition 'simple-condition
|
|
:format-control format-control
|
|
:format-arguments format-arguments))))
|
|
nil)
|
|
</PRE>
|
|
</TT> <P>
|
|
<P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issues</A>, <I>not part of the specification</I>, apply to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss091.htm">DEBUGGER-HOOK-VS-BREAK:CLARIFY</A><LI> <A REL=CHILD HREF="../Issues/iss170.htm">FORMAT-STRING-ARGUMENTS:SPECIFY</A><P></UL><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>
|