This is the policy-cond Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:18:53 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
policy-cond
Tools to insert code based on compiler policy.
Robert Smith <quad@symbo1ics.com>
Robert Smith <quad@symbo1ics.com>
BSD 3-clause (See LICENSE)
POLICY-COND provides tools to insert and execute code based on one’s compiler’s OPTIMIZE policy. It also contains a contract-like notion of ’expectations’, which allow dynamic checking or inclusion of various things to happen depending on compiler policy.
sb-cltl2
(system)., for feature :sbcl
cl-environments
(system)., for feature (:not (:or :sbcl :lispworks :cmucl :ccl :allegro))
license.txt
(file).
package.lisp
(file).
policy-cond.lisp
(file).
expectations.lisp
(file).
policy.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
policy-cond/policy-cond.asd
policy-cond/package.lisp
policy-cond/policy-cond.lisp
policy-cond/expectations.lisp
policy-cond/policy.lisp
policy-cond/package.lisp
license.txt
(file).
policy-cond
(system).
policy-cond/policy-cond.lisp
package.lisp
(file).
policy-cond
(system).
declaration-information
(function).
policy-cond
(macro).
policy-if
(macro).
with-policy
(macro).
policy
(macro).
policy-cond/expectations.lisp
policy-cond.lisp
(file).
policy-cond
(system).
with-expectations
(macro).
policy-cond/policy.lisp
expectations.lisp
(file).
policy-cond
(system).
if
(macro).
Packages are listed by definition order.
policy-cond
common-lisp
.
declaration-information
(function).
policy-cond
(macro).
policy-if
(macro).
with-expectations
(macro).
with-policy
(macro).
policy
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Intended to be used with read macros. FORM should be a policy expression as described in POLICY-COND:POLICY-COND. For example,
#+#.(policy:if (> speed safety)) EXPRESSION
Like COND, except each clause predicate is a policy expression. A
policy expression is a boolean expression using optimize declaration
qualities such as SPEED, SAFETY, DEBUG, COMPILATION-SPEED, etc. as if
they’re lexically bound to their actual value.
The result of POLICY-COND will be the first clause whose policy expression is satisfied. This is computed at compile time based off the current compiler policy.
If the policy expression EXPR is true, then expand into THEN, otherwise into ELSE. The policy expression is as described in POLICY-COND.
Execute BODY with expectations laid out by the clauses EXPECTATIONS when the policy expression POLICY holds true. When POLICY does not hold true, then EXPECTATIONS will be explicitly checked at runtime.
EXPECTATIONS should be lists of one of the following forms.
Type Expectation: (TYPE <type> <vars-or-exprs>...)
Assert that the variables and expressions <vars-or-exprs> should
have the type <type>. If the POLICY is met, then declarations
will be made for the variables only.
Return Type Expectation: (RETURNS [<type>*])
Assert that the result of a form obeys a certain type. Multiple
types indicate multiple values are returned. If the POLICY is
met, then the assertion will be elided at runtime.
Assertion Expectation: (ASSERTION <assertion> [(place*) [datum-form argument-form*]])
Assert that the assertion <assertion> should be true. If the
POLICY is met, then the assertion will be elided at runtime.
Conditional Expectation: (OR-ELSE <predicate> <resulting action>)
Check that the predicate <predicate> is true, or else perform
<resulting action>. If the POLICY is met, elide the check and
action. This clause is principally used for having special
conditions get raised.
Inline Expectation: (INLINE [<symbol>*])
Inline the functions designated by the symbols <symbol> if POLICY
is met.
Execute the body BODY with the global optimize policy set to
POLICY. Once BODY has finished executing, restore the compiler policy
to its original state.
For local declarations, use LOCALLY.
Get the declaration information for the environment ENV.
Jump to: | D F I M P W |
---|
Jump to: | D F I M P W |
---|
Jump to: | E F L P S |
---|
Jump to: | E F L P S |
---|