<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 10 Mar 2015, at 17:02, Edi Weitz <<a href="mailto:edi@weitz.de" class="">edi@weitz.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi everybody,<br class=""><br class="">After rummaging around in the HyperSpec and various implementation<br class="">manuals I came to the following conclusion:<br class=""><br class="">1. The standard doesn't prescribe such thing as a default safety level<br class="">for CL implementations and there's no portable way to figure out the<br class="">safety level of the global environment.  (And the same holds for other<br class="">optimize qualities.)  The closest I could find in the CLHS is 3.3.1<br class="">where they talk about an "implementation that always processes code as<br class="">if safety were high."  From this I conclude that implementations are<br class="">allowed NOT to do this or otherwise there would be no need to mention<br class="">it.<br class=""><br class="">The LispWorks manual for example describes the defaults in section 9.5<br class="">about compiler control, but for SBCL I couldn't find them in the<br class="">manual.<br class=""><br class="">2. The standard doesn't prescribe what should happen if you try to<br class="">write an element of a wrong type to a specialized array, even in safe<br class="">code.<br class=""><br class="">Both LispWorks and SBCL will by default complain in this case but my<br class="">understanding is that you can't rely on this in portable code.<br class=""><br class="">So, my question is whether the above is correct or if I missed something?<br class=""></div></blockquote></div><div class=""><br class=""></div>Yes. <div class=""><br class=""></div><div class="">Notably, with (safety 0), Common Lisp implementation could be as good as common C implementations...</div><div class=""><br class=""></div><div class="">This is why it is very bad to put optimization declarations in libraries (well, if they're not (safety 3) (speed 0)): </div><div class="">it HAS and WILL make users lose days in debugging because YOUR, Edi, libraries, compiled on conforming</div><div class="">implementations fail to detect errors.</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">-- <br class="">__Pascal J. Bourguignon__<br class=""><br class=""><br class=""></div></div>

</div>
<br class=""></div></body></html>