Previous: Package Lock Concepts, Up: Package Locks


11.2 Package Lock Dictionary

— Declaration: disable-package-locks [sb-ext]

Syntax: (sb-ext:disable-package-locks symbol*)

Disables package locks affecting the named symbols during compilation in the lexical scope of the declaration. Disabling locks on symbols whose home package is unlocked, or disabling an already disabled lock, has no effect.

— Declaration: enable-package-locks [sb-ext]

Syntax: (sb-ext:enable-package-locks symbol*)

Re-enables package locks affecting the named symbols during compilation in the lexical scope of the declaration. Enabling locks that were not first disabled with sb-ext:disable-package-locks declaration, or enabling locks that are already enabled has no effect.

— Condition: package-lock-violation [sb-ext]

Class precedence list: package-lock-violation, package-error, error, serious-condition, condition, t

Subtype of cl:package-error. A subtype of this error is signalled when a package-lock is violated.

— Condition: package-locked-error [sb-ext]

Class precedence list: package-locked-error, package-lock-violation, package-error, error, serious-condition, condition, t

Subtype of sb-ext:package-lock-violation. An error of this type is signalled when an operation on a package violates a package lock.

— Condition: symbol-package-locked-error [sb-ext]

Class precedence list: symbol-package-locked-error, package-lock-violation, package-error, error, serious-condition, condition, t

Subtype of sb-ext:package-lock-violation. An error of this type is signalled when an operation on a symbol violates a package lock. The symbol that caused the violation is accessed by the function sb-ext:package-locked-error-symbol.

— Function: package-locked-error-symbol [sb-ext] symbol-package-locked-error

Returns the symbol that caused the symbol-package-locked-error condition.

— Function: package-locked-p [sb-ext] package

Returns t when package is locked, nil otherwise. Signals an error if package doesn't designate a valid package.

— Function: lock-package [sb-ext] package

Locks package and returns t. Has no effect if package was already locked. Signals an error if package is not a valid package designator

— Function: unlock-package [sb-ext] package

Unlocks package and returns t. Has no effect if package was already unlocked. Signals an error if package is not a valid package designator.

— Function: package-implemented-by-list [sb-ext] package

Returns a list containing the implementation packages of package. Signals an error if package is not a valid package designator.

— Function: package-implements-list [sb-ext] package

Returns the packages that package is an implementation package of. Signals an error if package is not a valid package designator.

— Function: add-implementation-package [sb-ext] packages-to-add &optional package

Adds packages-to-add as implementation packages of package. Signals an error if package or any of the packages-to-add is not a valid package designator.

— Function: remove-implementation-package [sb-ext] packages-to-remove &optional package

Removes packages-to-remove from the implementation packages of package. Signals an error if package or any of the packages-to-remove is not a valid package designator.

— Macro: without-package-locks [sb-ext] &body body

Ignores all runtime package lock violations during the execution of body. Body can begin with declarations.

— Macro: with-unlocked-packages [sb-ext] (&rest packages) &body forms

Unlocks packages for the dynamic scope of the body. Signals an error if any of packages is not a valid package designator.

— Macro: defpackage [cl] name [[option]]* => package

Options are extended to include the following:

Example:

          (defpackage "FOO" (:export "BAR") (:lock t) (:implement))
          (defpackage "FOO-INT" (:use "FOO") (:implement "FOO" "FOO-INT"))
          
          ;;; is equivalent to
          
          (defpackage "FOO") (:export "BAR"))
          (lock-package "FOO")
          (remove-implementation-package "FOO" "FOO")
          (defpackage "FOO-INT" (:use "BAR"))
          (add-implementation-package "FOO-INT" "FOO")