Package Lock Violations - SBCL 1.0.31 User Manual
Description: SBCL 1.0.31 User Manual

Next: Package Locks in Compiled Code, Previous: Implementation Packages, Up: Package Lock Concepts

#### 11.1.3 Package Lock Violations

##### 11.1.3.1 Lexical Bindings and Declarations

Lexical bindings or declarations that violate package locks cause result in a `program-error` being signalled at when the form that violates package locks would be executed.

A complete listing of operators affect by this is: `let`, `let*`, `flet`, `labels`, `macrolet`, and `symbol-macrolet`, `declare`.

Package locks affecting both lexical bindings and declarations can be disabled locally with `sb-ext:disable-package-locks` declaration, and re-enabled with `sb-ext:enable-package-locks` declaration.

Example:

         (in-package :locked)

         (defun foo () ...)

         (defmacro with-foo (&body body)
           `(locally (declare (disable-package-locks locked:foo))
              (flet ((foo () ...))
                (declare (enable-package-locks locked:foo)) ; re-enable for body
                ,@body)))

##### 11.1.3.2 Other Operations

If an non-lexical operation violates a package lock, a continuable error that is of a subtype of `sb-ext:package-lock-violation` (subtype of `package-error`) is signalled when the operation is attempted.

Additional restarts may be established for continuable package lock violations for interactive use.

The actual type of the error depends on circumstances that caused the violation: operations on packages signal errors of type `sb-ext:package-locked-error`, and operations on symbols signal errors of type `sb-ext:symbol-package-locked-error`.