Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e3d62627d1d1aab7ab1be2dd7f65a872 > files > 236

ecl-10.4.1-1.fc14.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter&#160;2.&#160;Evaluation and compilation</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="pt01.html" title="Part&#160;I.&#160;Standards"><link rel="prev" href="ch01.html" title="Chapter&#160;1.&#160;Overview"><link rel="next" href="ch03.html" title="Chapter&#160;3.&#160;Data and control flow"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;2.&#160;Evaluation and compilation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a>&#160;</td><th width="60%" align="center">Part&#160;I.&#160;Standards</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch03.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter&#160;2.&#160;Evaluation and compilation"><div class="titlepage"><div><div><h2 class="title"><a name="ansi.evaluation-and-compilation"></a>Chapter&#160;2.&#160;Evaluation and compilation</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ch02.html#ansi.declarations">2.1. Declarations</a></span></dt><dd><dl><dt><span class="section"><a href="ch02.html#ansi.declarations.optimize">2.1.1. <code class="function">OPTIMIZE</code></a></span></dt></dl></dd></dl></div><div class="section" title="2.1.&#160;Declarations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ansi.declarations"></a>2.1.&#160;Declarations</h2></div></div></div><div class="section" title="2.1.1.&#160;OPTIMIZE"><div class="titlepage"><div><div><h3 class="title"><a name="ansi.declarations.optimize"></a>2.1.1.&#160;<code class="function">OPTIMIZE</code></h3></div></div></div><p>The <code class="function">OPTIMIZE</code> declaration includes three concepts:
   <code class="function">DEBUG</code>, <code class="function">SPEED</code>,
   <code class="function">SAFETY</code> and <code class="function">SPACE</code>. Each of these
   declarations can take one of the integer values 0, 1, 2 and 3. According to
   these values, the implementation may decide how to compie or interpret a
   given lisp form.</p><p><span class="application">ECL</span> currently does not use all these declarations, but some of them
   definitely affect the speed and behavior of compiled functions. For
   instance, the <code class="function">DEBUG</code> declaration, as shown in <a class="xref" href="ch02.html#table.optimize.debug" title="Table&#160;2.1.&#160;Behavior for different leves of DEBUG">Table&#160;2.1</a>, if the value of debugging is zero, the
   function will not appear in the debugger and, if redefined, some functions
   might not see the redefinition.</p><div class="table"><a name="table.optimize.debug"></a><p class="title"><b>Table&#160;2.1.&#160;Behavior for different leves of DEBUG</b></p><div class="table-contents"><table summary="Behavior for different leves of DEBUG" border="1"><colgroup><col><col><col><col><col></colgroup><thead><tr><th>Behavior</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><td>Compiled functions in the same source file are called
       directly</td><td>Y</td><td>Y</td><td>N</td><td>N</td></tr><tr><td>Compiled function appears in debugger backtrace</td><td>N</td><td>N</td><td>Y</td><td>Y</td></tr><tr><td>All functions get a global entry, that is, SI:C-LOCAL is
       ignored.</td><td>N</td><td>N</td><td>Y</td><td>Y</td></tr></tbody></table></div></div><br class="table-break"><p>A bit more critical is the value of <code class="function">SAFETY</code>
   because as shown in Table <a class="xref" href="ch02.html#table.optimize.safety" title="Table&#160;2.2.&#160;Behavior for different leves of SAFETY">Table&#160;2.2</a>, it may
   affect the safety checks generated by the compiler. In particular, in some
   circumstances the compiler may assume that the arguments to a function are
   properly typed. For instance, if you compile with a low value of
   <code class="function">SAFETY</code>, and invoke <code class="function">RPLACA</code>, the
   consequences are unspecified.</p><div class="table"><a name="table.optimize.safety"></a><p class="title"><b>Table&#160;2.2.&#160;Behavior for different leves of SAFETY</b></p><div class="table-contents"><table summary="Behavior for different leves of SAFETY" border="1"><colgroup><col><col><col><col><col></colgroup><thead><tr><th>Behavior</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><td>The compiler generates type checks for the arguments of a lambda
       form, thus enforcing any type declaration written by the user.</td><td>N</td><td>Y</td><td>Y</td><td>Y</td></tr><tr><td>The value of an expression or a variable declared by the user is
       assumed to be right.</td><td>Y</td><td>Y</td><td>N</td><td>N</td></tr><tr><td>We believe type declarations and type inference and, if the type
       of a form is inferred to be right for a function, slot accessor, etc,
       this may be inlined. Affects functions like CAR, CDR, etc</td><td>Y</td><td>Y</td><td>N</td><td>N</td></tr><tr><td>We believe types defined before compiling a file not change
       before the compiled code is loaded.</td><td>Y</td><td>Y</td><td>N</td><td>N</td></tr><tr><td>Arguments in a lisp form are assumed to have the appropriate types
       so that the form will not fail.</td><td>Y</td><td>N</td><td>N</td><td>N</td></tr><tr><td>The slots or fields in a lisp object are accessed directly
       without type checks even if the type of the object could not be inferred
       (see line above). Affects functions like PATHNAME-TYPE, CAR, REST,
       etc.</td><td>Y</td><td>N</td><td>N</td><td>N</td></tr></tbody></table></div></div><br class="table-break"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;1.&#160;Overview&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;3.&#160;Data and control flow</td></tr></table></div></body></html>