X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=doc%2Fmanual%2Fcompiler.texinfo;h=a3cb00c91cdc17b2efadf91c400d45dd70a51afe;hb=8852534331f5505348d1217a3080ee25e09ec47e;hp=9a3533de7d10deec7afd398be0485911dbb115a1;hpb=a2e934ad4e9545f1c6bbd8a9e9d3dd4d1c4698d9;p=sbcl.git diff --git a/doc/manual/compiler.texinfo b/doc/manual/compiler.texinfo index 9a3533d..a3cb00c 100644 --- a/doc/manual/compiler.texinfo +++ b/doc/manual/compiler.texinfo @@ -156,8 +156,8 @@ to the @code{sb-ext:compiler-note}, and is used for problems which are too mild for the standard condition classes, typically hints about how efficiency might be improved. The @code{sb-ext:code-deletion-note}, a subtype of @code{compiler-note}, is signalled when the compiler -deletes user-supplied code, usually after proving that the code in -question is unreachable. +deletes user-supplied code after proving that the code in question is +unreachable. Future work for SBCL includes expanding this hierarchy of types to allow more fine-grained control over emission of diagnostic messages. @@ -456,11 +456,10 @@ one level. @comment node-name, next, previous, up @section Handling of Types -The most unusual features of the SBCL compiler (which is very -similar to the original CMUCL compiler, also known as @dfn{Python}) -is its unusually sophisticated understanding of the Common Lisp type -system and its unusually conservative approach to the implementation -of type declarations. +One of the most important features of the SBCL compiler (similar to +the original CMUCL compiler, also known as @dfn{Python}) is its fairly +sophisticated understanding of the Common Lisp type system and its +conservative approach to the implementation of type declarations. These two features reward the use of type declarations throughout development, even when high performance is not a concern. Also, as @@ -493,21 +492,28 @@ involving the @code{satisfies} type specifier. @subsection Declarations as Assertions @findex safety -The SBCL compiler treats type declarations differently from most -other Lisp compilers. Under default compilation policy the compiler -doesn't blindly believe type declarations, but considers them -assertions about the program that should be checked: all type -declarations that have not been proven to always hold are asserted at -runtime. +The SBCL compiler treats type declarations differently from most other +Lisp compilers. Under default compilation policy the compiler doesn't +blindly believe type declarations, but considers them assertions about +the program that should be checked: all type declarations that have +not been proven to always hold are asserted at runtime. @quotation @emph{Remaining bugs in the compiler's handling of types unfortunately provide some exceptions to this rule, see @ref{Implementation -Limitations}).} +Limitations}.} @end quotation -There are three type checking policies available in SBCL, -selectable via @code{optimize} declarations. +CLOS slot types form a notable exception. Types declared using the +@code{:type} slot option in @code{defclass} are asserted if and only +if the class was defined in @emph{safe code} and the slot access +location is in @emph{safe code} as well. This laxness does not pose +any internal consistency issues, as the CLOS slot types are not +available for the type inferencer, nor do CLOS slot types provide any +efficiency benefits. + +There are three type checking policies available in SBCL, selectable +via @code{optimize} declarations. @table @strong