46 lines
10 KiB
HTML
46 lines
10 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: Section 3.5.1.1</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="03_ea.htm">
|
|
<LINK REL=UP HREF="03_ea.htm">
|
|
<LINK REL=NEXT HREF="03_eaaa.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="03_ea.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="03_ea.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="03_eaaa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<H2>
|
|
3.5.1.1 Safe and Unsafe Calls</H2> <P>
|
|
A <A REL=DEFINITION HREF="26_glo_c.htm#call"><I>call</I></A> is a <A REL=DEFINITION HREF="26_glo_s.htm#safe_call"><I>safe call</I></A> if each of the following is either <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A> <A REL=DEFINITION HREF="26_glo_c.htm#code"><I>code</I></A> or <A REL=DEFINITION HREF="26_glo_s.htm#system_code"><I>system code</I></A> (other than <A REL=DEFINITION HREF="26_glo_s.htm#system_code"><I>system code</I></A> that results from <A REL=DEFINITION HREF="26_glo_m.htm#macro_expansion"><I>macro expansion</I></A> of <A REL=DEFINITION HREF="26_glo_p.htm#programmer_code"><I>programmer code</I></A>): <P><DL><DT>* the <A REL=DEFINITION HREF="26_glo_c.htm#call"><I>call</I></A>. <DD><DT>* the definition of the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> being <I>called</I>. <DD><DT>* the point of <A REL=DEFINITION HREF="26_glo_f.htm#functional_evaluation"><I>functional evaluation</I></A> <P><DD></DL><P>
|
|
The following special cases require some elaboration: <P>
|
|
<P><DL><DT>* If the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> being called is a <A REL=DEFINITION HREF="26_glo_g.htm#generic_function"><I>generic function</I></A>, it is considered <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A> if all of the following are <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A> <A REL=DEFINITION HREF="26_glo_c.htm#code"><I>code</I></A> or <A REL=DEFINITION HREF="26_glo_s.htm#system_code"><I>system code</I></A>: <P><DD>
|
|
<P><DL><DT>-- its definition (if it was defined explicitly). <DD><DT>-- the <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A> definitions for all <A REL=DEFINITION HREF="26_glo_a.htm#applicable"><I>applicable</I></A> <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>methods</I></A>. <DD><DT>-- the definition of its <A REL=DEFINITION HREF="26_glo_m.htm#method_combination"><I>method combination</I></A>. <P><DD></DL><P>
|
|
<DT>* For the form <TT>(coerce </TT><I>x</I><TT> 'function)</TT>, where <I>x</I> is a <A REL=DEFINITION HREF="26_glo_l.htm#lambda_expression"><I>lambda expression</I></A>, the value of the <A REL=DEFINITION HREF="26_glo_o.htm#optimize_quality"><I>optimize quality</I></A> <A REL=DEFINITION HREF="d_optimi.htm#safety"><B>safety</B></A> in the global environment at the time the <A REL=DEFINITION HREF="f_coerce.htm#coerce"><B>coerce</B></A> is <I>executed</I> applies to the resulting <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A>. <P><DD>
|
|
<P>
|
|
<P>
|
|
<DT>* For a call to the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_ensure.htm#ensure-generic-function"><B>ensure-generic-function</B></A>, the value of the <A REL=DEFINITION HREF="26_glo_o.htm#optimize_quality"><I>optimize quality</I></A> <A REL=DEFINITION HREF="d_optimi.htm#safety"><B>safety</B></A> in the <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environment</I></A> <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> passed as the <TT>:environment</TT> <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> applies to the resulting <A REL=DEFINITION HREF="26_glo_g.htm#generic_function"><I>generic function</I></A>. <P><DD>
|
|
<DT>* For a call to <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> with a <A REL=DEFINITION HREF="26_glo_l.htm#lambda_expression"><I>lambda expression</I></A> as the <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A>, the value of the <A REL=DEFINITION HREF="26_glo_o.htm#optimize_quality"><I>optimize quality</I></A> <B>safety</B> in the <A REL=DEFINITION HREF="26_glo_g.htm#global_environment"><I>global environment</I></A> at the time <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> is <I>called</I> applies to the resulting <A REL=DEFINITION HREF="26_glo_c.htm#compiled_function"><I>compiled function</I></A>. <P><DD>
|
|
<DT>* For a call to <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> with only one argument, if the original definition of the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> was <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A>, then the resulting <A REL=DEFINITION HREF="26_glo_c.htm#compiled_function"><I>compiled function</I></A> must also be <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A>. <P><DD>
|
|
<DT>* A <A REL=DEFINITION HREF="26_glo_c.htm#call"><I>call</I></A> to a <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A> by <A REL=DEFINITION HREF="f_call_n.htm#call-next-method"><B>call-next-method</B></A> must be considered <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A> if each of the following is <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A> <A REL=DEFINITION HREF="26_glo_c.htm#code"><I>code</I></A> or <A REL=DEFINITION HREF="26_glo_s.htm#system_code"><I>system code</I></A>: <P><DD>
|
|
<P><DL><DT>-- the definition of the <A REL=DEFINITION HREF="26_glo_g.htm#generic_function"><I>generic function</I></A> (if it was defined explicitly). <DD><DT>-- the <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A> definitions for all <A REL=DEFINITION HREF="26_glo_a.htm#applicable"><I>applicable</I></A> <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>methods</I></A>. <DD><DT>-- the definition of the <A REL=DEFINITION HREF="26_glo_m.htm#method_combination"><I>method combination</I></A>. <DD><DT>-- the point of entry into the body of the <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A> <A REL=DEFINITION HREF="26_glo_d.htm#defining_form"><I>defining form</I></A>, where the <A REL=DEFINITION HREF="26_glo_b.htm#binding"><I>binding</I></A> of <A REL=DEFINITION HREF="f_call_n.htm#call-next-method"><B>call-next-method</B></A> is established. <DD><DT>-- the point of <A REL=DEFINITION HREF="26_glo_f.htm#functional_evaluation"><I>functional evaluation</I></A> of the name <A REL=DEFINITION HREF="f_call_n.htm#call-next-method"><B>call-next-method</B></A>. <P><DD></DL><P>
|
|
<P></DL><P>
|
|
An <A REL=DEFINITION HREF="26_glo_u.htm#unsafe_call"><I>unsafe call</I></A> is a <A REL=DEFINITION HREF="26_glo_c.htm#call"><I>call</I></A> that is not a <A REL=DEFINITION HREF="26_glo_s.htm#safe_call"><I>safe call</I></A>. <P>
|
|
The informal intent is that the <A REL=DEFINITION HREF="26_glo_p.htm#programmer"><I>programmer</I></A> can rely on a <A REL=DEFINITION HREF="26_glo_c.htm#call"><I>call</I></A> to be <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A>, even when <A REL=DEFINITION HREF="26_glo_s.htm#system_code"><I>system code</I></A> is involved, if all reasonable steps have been taken to ensure that the <A REL=DEFINITION HREF="26_glo_c.htm#call"><I>call</I></A> is <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A>. For example, if a <A REL=DEFINITION HREF="26_glo_p.htm#programmer"><I>programmer</I></A> calls <A REL=DEFINITION HREF="f_mapc_.htm#mapcar"><B>mapcar</B></A> from <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A> <A REL=DEFINITION HREF="26_glo_c.htm#code"><I>code</I></A> and supplies a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> that was <I>compiled</I> as <A REL=DEFINITION HREF="26_glo_s.htm#safe"><I>safe</I></A>, the <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A> is required to ensure that <A REL=DEFINITION HREF="f_mapc_.htm#mapcar"><B>mapcar</B></A> makes a <A REL=DEFINITION HREF="26_glo_s.htm#safe_call"><I>safe call</I></A> as well. <P>
|
|
|
|
|
|
<A REL=CHILD HREF="03_eaaa.htm"><H2>
|
|
3.5.1.1.1 Error Detection Time in Safe Calls</H2></A><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/iss181.htm">GENERIC-FLET-POORLY-DESIGNED:DELETE</A><LI> <A REL=CHILD HREF="../Issues/iss342.htm">SYNTACTIC-ENVIRONMENT-ACCESS:RETRACTED-MAR91</A><LI> <A REL=CHILD HREF="../Issues/iss011.htm">ARGUMENT-MISMATCH-ERROR-MOON:FIX</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>
|