1.0.11.16: Fix tyops in the manual
[sbcl.git] / doc / manual / compiler.texinfo
index ee242f4..c23af6a 100644 (file)
@@ -11,11 +11,12 @@ naive translation. Efficiency issues are sufficiently varied and
 separate that they have their own chapter, @ref{Efficiency}.
 
 @menu
 separate that they have their own chapter, @ref{Efficiency}.
 
 @menu
-* Diagnostic Messages::         
+* Diagnostic Messages::
 * Handling of Types::           
 * Compiler Policy::             
 * Compiler Errors::             
 * Open Coding and Inline Expansion::  
 * Handling of Types::           
 * Compiler Policy::             
 * Compiler Errors::             
 * Open Coding and Inline Expansion::  
+* Interpreter::
 @end menu
 
 @node  Diagnostic Messages
 @end menu
 
 @node  Diagnostic Messages
@@ -77,6 +78,12 @@ Cancels the effect of a previous @code{sb-ext:muffle-condition}
 declaration.
 @end deffn
 
 declaration.
 @end deffn
 
+Various details of @emph{how} the compiler messages are printed can be
+controlled via the alist
+@code{sb-ext:*compiler-print-variable-alist*}.
+
+@include var-sb-ext-star-compiler-print-variable-alist-star.texinfo
+
 @c <!-- FIXME: How much control over error messages is in SBCL?
 @c      _     How much should be? How much of this documentation should
 @c      _     we save or adapt? 
 @c <!-- FIXME: How much control over error messages is in SBCL?
 @c      _     How much should be? How much of this documentation should
 @c      _     we save or adapt? 
@@ -99,15 +106,6 @@ declaration.
 @c      _   which is useful when debugging macros.
 @c      _ \end{defvar}
 @c      _ 
 @c      _   which is useful when debugging macros.
 @c      _ \end{defvar}
 @c      _ 
-@c      _ \begin{defvar}{}{error-print-length}
-@c      _   \defvarx{error-print-level}
-@c      _ 
-@c      _   These variables are the print level and print length used in
-@c      _   printing error messages.  The default values are \code{5} and
-@c      _   \code{3}.  If null, the global values of \code{*print-level*} and
-@c      _   \code{*print-length*} are used.
-@c      _ \end{defvar}
-@c      _ 
 @c      _ \begin{defmac}{extensions:}{define-source-context}{%
 @c      _     \args{\var{name} \var{lambda-list} \mstar{form}}}
 @c      _ 
 @c      _ \begin{defmac}{extensions:}{define-source-context}{%
 @c      _     \args{\var{name} \var{lambda-list} \mstar{form}}}
 @c      _ 
@@ -124,12 +122,11 @@ declaration.
 @c      _ 
 @c      _ -->
 
 @c      _ 
 @c      _ -->
 
-
 @node  Diagnostic Severity
 @comment  node-name,  next,  previous,  up
 @subsection Diagnostic Severity
 @cindex Severity of compiler messages
 @node  Diagnostic Severity
 @comment  node-name,  next,  previous,  up
 @subsection Diagnostic Severity
 @cindex Severity of compiler messages
-@cindex compiler diagnostic severity
+@cindex Compiler Diagnostic Severity
 @tindex error
 @tindex warning
 @tindex style-warning
 @tindex error
 @tindex warning
 @tindex style-warning
@@ -393,7 +390,7 @@ This message is not saying ``there is a problem somewhere in this
 @node The Processing Path
 @comment  node-name,  next,  previous,  up
 @subsubsection The Processing Path
 @node The Processing Path
 @comment  node-name,  next,  previous,  up
 @subsubsection The Processing Path
-@cindex Processing path
+@cindex Processing Path
 @cindex Macroexpansion
 @cindex Source-to-source transformation
 
 @cindex Macroexpansion
 @cindex Source-to-source transformation
 
@@ -525,7 +522,7 @@ default compilation policy provides full type checks.
 Any or all type declarations may be believed without runtime
 assertions, and assertions that are done may be imprecise.
 
 Any or all type declarations may be believed without runtime
 assertions, and assertions that are done may be imprecise.
 
-Used when @code{(> 0 safety (max speed space compilation-speed)}.
+Used when @code{(< 0 safety (max speed space compilation-speed)}.
 
 @item No Type Checks
 All declarations are believed without assertions. Also disables
 
 @item No Type Checks
 All declarations are believed without assertions. Also disables
@@ -768,34 +765,8 @@ Policy Control}.
 
 Ordinarily, when the @code{speed} quality is high, the compiler emits
 notes to notify the programmer about its inability to apply various
 
 Ordinarily, when the @code{speed} quality is high, the compiler emits
 notes to notify the programmer about its inability to apply various
-optimizations. 
-
-Compiler diagnostics (of any severity other than @code{error}:
-@pxref{Diagnostic Severity}) can be silenced by using the
-@code{sb-ext:muffle-conditions} declaration, specifying the type of
-condition that is to be muffled (using an associated
-@code{muffle-warning} restart). 
-
-To muffle all compiler notes:
-
-@lisp
-(declaim (sb-ext:muffle-conditions sb-ext:compiler-note))
-@end lisp
-
-Compiler diagnostics can also be muffled in the lexical scope of a
-declaration, and also lexically unmuffled by the use of the
-sb-ext:unmuffle-conditions, for instance:
-
-@lisp
-(defun foo (x)
-  (declare (optimize speed) (fixnum x))
-  (declare (sb-ext:muffle-conditions sb-ext:compiler-note))
-  (values (* x 5) ; no compiler note from this
-    (locally
-      (declare (sb-ext:unmuffle-conditions sb-ext:compiler-note))
-      ;; this one gives a compiler note
-      (* x -5))))
-@end lisp
+optimizations. For selective muffling of these notes @xref{Controlling
+Verbosity}.
 
 The value of @code{space} mostly influences the compiler's decision
 whether to inline operations, which tend to increase the size of
 
 The value of @code{space} mostly influences the compiler's decision
 whether to inline operations, which tend to increase the size of
@@ -888,6 +859,7 @@ is to slow the program by causing cache misses or even swapping.
 @c      _  In addition to suppressing type checks, \code{0} also suppresses
 @c      _  argument count checking, unbound-symbol checking and array bounds
 @c      _  checks.
 @c      _  In addition to suppressing type checks, \code{0} also suppresses
 @c      _  argument count checking, unbound-symbol checking and array bounds
 @c      _  checks.
+@c      _  ... and checking of tag existence in RETURN-FROM and GO.
 @c      _
 @c      _\item[\code{extensions:inhibit-warnings}] \cindex{inhibit-warnings
 @c      _    optimization quality}This is a CMU extension that determines how
 @c      _
 @c      _\item[\code{extensions:inhibit-warnings}] \cindex{inhibit-warnings
 @c      _    optimization quality}This is a CMU extension that determines how
@@ -1045,8 +1017,8 @@ character position and gives up on the entire source file.
 @comment  node-name,  next,  previous,  up
 @section Open Coding and Inline Expansion
 @cindex Open-coding
 @comment  node-name,  next,  previous,  up
 @section Open Coding and Inline Expansion
 @cindex Open-coding
-@cindex inline expansion
-@cindex static functions
+@cindex Inline expansion
+@cindex Static functions
 
 Since Common Lisp forbids the redefinition of standard functions, the
 compiler can have special knowledge of these standard functions
 
 Since Common Lisp forbids the redefinition of standard functions, the
 compiler can have special knowledge of these standard functions
@@ -1117,3 +1089,20 @@ open-coded. Even when not open-coded, a call to a standard function
 may be transformed into a different function call (as in the last
 example) or compiled as @emph{static call}. Static function call uses
 a more efficient calling convention that forbids redefinition.
 may be transformed into a different function call (as in the last
 example) or compiled as @emph{static call}. Static function call uses
 a more efficient calling convention that forbids redefinition.
+
+@node  Interpreter
+@comment  node-name,  next,  previous,  up
+@section Interpreter
+@cindex Interpreter
+@vindex sb-ext:*evaluator-mode*
+
+By default SBCL implements @code{eval} by calling the native code
+compiler. SBCL also includes an interpreter for use in special cases
+where using the compiler is undesirable, for example due to compilation
+overhead. Unlike in some other Lisp implementations, in SBCL interpreted
+code is not safer or more debuggable than compiled code.
+
+Switching between the compiler and the interpreter is done using the
+special variable @code{sb-ext:*evaluator-mode*}. As of 0.9.17, valid
+values for @code{sb-ext:*evaluator-mode*} are @code{:compile} and
+@code{:interpret}.