Previous: Package Locks in Compiled Code, Up: Package Lock Concepts

#### 11.1.5 Operations Violating Package Locks

##### 11.1.5.1 Operations on Packages

The following actions cause a package lock violation if the package operated on is locked, and `*package*` is not an implementation package of that package, and the action would cause a change in the state of the package (so e.g. exporting already external symbols is never a violation). Package lock violations caused by these operations signal errors of type `sb-ext:package-locked-error`.

1. Shadowing a symbol in a package.
2. Importing a symbol to a package.
3. Uninterning a symbol from a package.
4. Exporting a symbol from a package.
5. Unexporting a symbol from a package.
6. Changing the packages used by a package.
7. Renaming a package.
8. Deleting a package.

##### 11.1.5.2 Operations on Symbols

Following actions cause a package lock violation if the home package of the symbol operated on is locked, and `*package*` is not an implementation package of that package. Package lock violations caused by these action signal errors of type `sb-ext:symbol-package-locked-error`.

These actions cause only one package lock violation per lexically apparent violated package.

Example:

         ;;; Packages FOO and BAR are locked.
         ;;;
         ;;; Two lexically apparent violated packages: exactly two
         ;;; package-locked-errors will be signalled.

         (defclass foo:point ()
           ((x :accessor bar:x)
            (y :accessor bar:y)))

1. Binding or altering its value lexically or dynamically, or establishing it as a symbol-macro.

   Exceptions:

   - If the symbol is not defined as a constant, global symbol-macro or a global dynamic variable, it may be lexically bound or established as a local symbol macro.
   - If the symbol is defined as a global dynamic variable, it may be assigned or bound.
2. Defining, undefining, or binding it, or its setf name as a function.

   Exceptions:

   - If the symbol is not defined as a function, macro, or special operator it and its setf name may be lexically bound as a function.
3. Defining, undefining, or binding it as a macro or compiler macro.

   Exceptions:

   - If the symbol is not defined as a function, macro, or special operator it may be lexically bound as a macro.
4. Defining it as a type specifier or structure.
5. Defining it as a declaration with a declaration proclamation.
6. Declaring or proclaiming it special.
7. Declaring or proclaiming its type or ftype.

   Exceptions:

   - If the symbol may be lexically bound, the type of that binding may be declared.
   - If the symbol may be lexically bound as a function, the ftype of that binding may be declared.
8. Defining a setf expander for it.
9. Defining it as a method combination type.
10. Using it as the class-name argument to setf of find-class.
11. Defining it as a hash table test using `sb-ext:define-hash-table-test`.