|From: Raymond Toy <[EMAIL PROTECTED]>
  |Date: Tue, 02 May 2006 11:06:34 -0400

  |    Madhu>  (in-package "CL-USER")
  |    Madhu>  (ext:without-package-locks
  |    Madhu>   (defmacro mp::with-process-lock ((lock) &body body)
  |    Madhu>        `(mp:with-lock-held (,lock) ,@body)))
  |
  |    Madhu> but it just doesn't work -- not if you compile it, not
  |    if you load it, Madhu> or eval it at the repl, even if you
  |    intern WITH-PROCESS-LOCK in MP Madhu> beforehand. The package
  |    lock system just won't let you do it.
[...]
  |Yes, this does seem to be a bug.  Another workaround is to set
  |lisp::*enable-package-locked-errors* to nil.

Wanted to note that the following form (using the above workaround)
fails if the file it is in is being compiled.

(in-package "CL-USER")
(eval-when (:load-toplevel :execute :compile-toplevel)
  (setq lisp::*enable-package-locked-errors* nil)
  (defmacro mp::with-process-lock ((lock) &body body)
    `(mp:with-lock-held (,lock) ,@body))
  (setq lisp::*enable-package-locked-errors* t))

The intent is to write code that works both if compiled first and
loaded, and just loaded.
--
Best Regards
Madhu



Reply via email to