OPTIMIZE(3cl) |
Common Lisp Reference |
OPTIMIZE(3cl) |
NAME
optimize – advise compiler of attention to be given to qualities (declaration)
SYNOPSIS
(
optimize
(
)
) |
ARGUMENTS and VALUES
—an optimize quality.
0, 1, 2, or 3. —one of the integers
VALID CONTEXT
declaration or proclamation
BINDING TYPES AFFECTED
DESCRIPTION
Advises the compiler that each
should be given attention according to the specified corresponding value. Each must be a symbol naming an optimize quality; the names and meanings of the standard optimize qualities are:
compilation-speed |
speed of the compilation process |
debug |
ease of debugging |
safety |
run-time error checking |
space |
both code size and run-time space |
speed |
speed of the object code |
There may be other, implementation-defined optimize qualities.
A 0 means that the corresponding is totally unimportant, and 3 that the quality is extremely important; 1 and 2 are intermediate values, with 1 the neutral value. ( 3) can be abbreviated to .
Note that code which has the optimization (safety 3), or just safety, is called safe code.
The consequences are unspecified if a appears more than once with different s.
AFFECTED BY
(none)
EXCEPTIONAL SITUATIONS
(none)
NOTES
An optimize declaration never applies to either a variable or a function binding. An optimize declaration can only be a free declaration.
EXAMPLES
(defun ()
(declare (optimize (safety 2)))
( )
()
(do (( 0 (+ 1))
( (cdr )))
((null ))
;; This inner loop really needs to burn.
(declare (optimize speed))
(declare (fixnum ))
))
SEE ALSO
declare(3cl), declaim(3cl), proclaim(3cl)
AUTHOR and COPYRIGHT
Substantial portions of this page are taken from draft proposed American National Standard for Information Systems—Programming Language—Common Lisp, X3J13/94-101R, Version 15.17R, Fri 12-Aug-1994 6:35pm EDT; no copyright indicated.
Additional clarification and comments by Michael Marking <marking@tatanka.com>, http://www.tatanka.com/software/cl-manpages/; alternatively, https://github.com/wakinyantanka/cl-manpages/. Copyright 2017 Michael Marking as both an original and a derivative work.
Licensed under Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0).
This page last revised Wednesday 1 March 2017.