[closer-devel] [PATCH] make defpackage form fully describe package's state
Pascal Costanza
pc at p-cos.net
Wed Sep 16 10:46:39 UTC 2009
Hi Tobias,
Thanks a lot for the bug report. I had to find a different way to fix
this, to make sure that this also works in Common Lisp implementations
other than SBCL. ;)
But this was a good catch, so thanks indeed!
Best,
Pascal
On 15 Sep 2009, at 19:08, Tobias C. Rittweiler wrote:
>
> Uhm, for some reason that escapes me, the diff below came in
> reversed. You have to apply it by passing the -R flag to patch.
>
> -T.
>
> "Tobias C. Rittweiler" <...> writes:
>
>> CLHS specifies that consequences are undefined if a defpackage form
>> (on
>> evaluation) does not fully describe the package's state. And, indeed,
>> SBCL signals a warning in that case.
>>
>> That means that (progn (asdf:oos 'asdf:load-op :closer-mop :force t)
>> (asdf:oos 'asdf:load-op :closer-mop :force t))
>> will fail on SBCL.
>>
>> The attached patch makes the effort to generate a DEFPACKAGE form
>> which
>> correctly describes the final state of the package it defines.
>>
>> -T.
>>
>>
>> --- old-closer-mop/closer-mop-utility-packages.lisp 2009-09-15
>> 17:58:23.000000000 +0200
>> +++ new-closer-mop/closer-mop-utility-packages.lisp 2009-09-15
>> 17:58:23.000000000 +0200
>> @@ -1,22 +1,17 @@
>> (in-package :cl-user)
>>
>> -;;; We have to make sure that the DEFPACKAGE form fully describes
>> the
>> -;;; state of the package as CLHS specifies the consequences to be
>> -;;; undefined otherwise. And SBCL annoyingly^W rightfully signals
>> -;;; a warning in the case of reloading.
>> -(macrolet
>> - ((define-closer-cl-package (name &body options)
>> - `(defpackage ,name
>> - , at options
>> - (:export ,@(loop for sym being the external-symbols
>> of :common-lisp
>> - if (find-symbol (symbol-name
>> sym) :c2mop)
>> - collect it
>> - else collect sym))
>> - (:export ,@(loop for sym being the external-symbols
>> of :c2mop
>> - collect sym)))))
>> -
>> - (define-closer-cl-package #:closer-common-lisp
>> - (:nicknames #:c2cl)))
>> +(defpackage #:closer-common-lisp
>> + (:nicknames #:c2cl)
>> + (:use))
>> +
>> +(let ((syms (nunion (loop for sym being the external-symbols
>> of :common-lisp
>> + if (find-symbol (symbol-name sym) :c2mop)
>> + collect it
>> + else collect sym)
>> + (loop for sym being the external-symbols
>> of :c2mop
>> + collect sym))))
>> + (import syms :c2cl)
>> + (export syms :c2cl))
>>
>> (defpackage #:closer-common-lisp-user
>> (:nicknames #:c2cl-user)
>
>
> _______________________________________________
> closer-devel mailing list
> closer-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel
--
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium
More information about the closer-devel
mailing list