Madhu wrote:
> Errata, I posted too soon!
>
> |Date: 3 May 2006 12:08:43 +0530
> |From: Madhu <[EMAIL PROTECTED]>
> | |From: Raymond Toy <[EMAIL PROTECTED]>
> | |Date: Tue, 02 May 2006 11:06:34 -0400
> [...]
> |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.
>
> Apologies, but I see that this code can be expected to fail:
>
> |(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.
>
> The packge lock switch has to be set at toplevel for it to work.
>
> (in-package "CL-USER")
> (eval-when (:load-toplevel :execute :compile-toplevel)
> (setq lisp::*enable-package-locked-errors* nil))
> (eval-when (:load-toplevel :execute :compile-toplevel)
> (defmacro mp::with-process-lock ((lock) &body body)
> `(mp:with-lock-held (,lock) ,@body)))
> (eval-when (:load-toplevel :execute :compile-toplevel)
> (setq lisp::*enable-package-locked-errors* t))
Can you try the following? This works for me.
(eval-when (:compile-toplevel :load-toplevel :execute)
(ext:compiler-let ((lisp::*enable-package-locked-errors* nil))
(defmacro multiprocessing::with-process-lock ((lock) &body body)
`(multiprocessing:with-lock-held (,lock) ,@body))))
If this works, I think we can change without-package-locks to use
compile-let instead of let.
Ray