Movatterモバイル変換


[0]ホーム

URL:


[LISPWORKS][Common Lisp HyperSpec (TM)][Previous][Up][Next]


DeclarationOPTIMIZE

Syntax:

(optimize{quality| (qualityvalue)}*)

Arguments:

quality---anoptimize quality.

value---one of theintegers0,1,2, or3.

Valid Context:

declaration orproclamation

Binding Types Affected: None.

Description:

Advises the compiler that eachquality should be given attention according to the specified correspondingvalue. Eachquality must be asymbol naming anoptimize quality; the names and meanings of the standardoptimize qualities are shown in the next figure.

Name               Meaningcompilation-speed  speed of the compilation processdebug              ease of debuggingsafety             run-time error checkingspace              both code size and run-time spacespeed              speed of the object code

Figure 3-25. Optimize qualities

There may be other,implementation-definedoptimize qualities.

Avalue0 means that the correspondingquality is totally unimportant, and3 that thequality is extremely important;1 and2 are intermediate values, with1 the neutral value.(quality 3) can be abbreviated toquality.

Note thatcode which has the optimization(safety 3), or justsafety, is calledsafecode.

The consequences are unspecified if aquality appears more than once withdifferentvalues.

Examples:

 (defun often-used-subroutine (x y)   (declare (optimize (safety 2)))   (error-check x y)   (hairy-setup x)   (do ((i 0 (+ i 1))        (z x (cdr z)))       ((null z))     ;; This inner loop really needs to burn.     (declare (optimize speed))     (declare (fixnum i))     ))

See Also:

declare,declaim,proclaim,Section 3.3.4 (Declaration Scope)

Notes:

Anoptimize declaration never applies to either avariable or afunctionbinding. Anoptimize declaration can only be afree declaration. For more information, seeSection 3.3.4 (Declaration Scope).


The followingX3J13 cleanup issue,not part of the specification, applies to this section:


[Starting Points][Contents][Index][Symbols][Glossary][Issues]
Copyright 1996-2005, LispWorks Ltd. All rights reserved.


[8]ページ先頭

©2009-2025 Movatter.jp