Just for the sake of completeness, here is another solution
that works fine in a similar situation:

(in-package :ext)

;;; Before modifying the package :ext, unlock it...
(eval-when (:compile-toplevel :load-toplevel :execute)
   (when (fboundp 'ext::package-lock)
     (setf (ext::package-lock (find-package :ext)) nil))
   (when (fboundp 'ext::package-definition-lock)
     (setf (ext::package-definition-lock (find-package :ext)) nil)))

(export 'ext::if*)

(defmacro if* (&rest args)
   ...)

;;; ... and lock it again afterwards.
(eval-when (:compile-toplevel :load-toplevel :execute)
   (when (fboundp 'ext::package-lock)
     (setf (ext::package-lock (find-package :ext)) t))
   (when (fboundp 'ext::package-definition-lock)
     (setf (ext::package-definition-lock (find-package :ext)) t)))

Of course, the lisp::*enable-package-locked-errors* solution is shorter.
Andreas


Reply via email to