From tcr at freebits.de Tue Sep 15 16:06:03 2009 From: tcr at freebits.de (Tobias C. Rittweiler) Date: Tue, 15 Sep 2009 18:06:03 +0200 Subject: [closer-devel] [PATCH] make defpackage form fully describe package's state Message-ID: <87skeoyyz8.fsf@freebits.de> 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: closer-mop-defpackage-fix.diff Type: text/x-diff Size: 1565 bytes Desc: not available URL: From tcr at freebits.de Tue Sep 15 17:08:13 2009 From: tcr at freebits.de (Tobias C. Rittweiler) Date: Tue, 15 Sep 2009 19:08:13 +0200 Subject: [closer-devel] [PATCH] make defpackage form fully describe package's state References: <87skeoyyz8.fsf@freebits.de> Message-ID: <87k500yw3m.fsf@freebits.de> 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) From pc at p-cos.net Wed Sep 16 10:46:39 2009 From: pc at p-cos.net (Pascal Costanza) Date: Wed, 16 Sep 2009 12:46:39 +0200 Subject: [closer-devel] [PATCH] make defpackage form fully describe package's state In-Reply-To: <87k500yw3m.fsf@freebits.de> References: <87skeoyyz8.fsf@freebits.de> <87k500yw3m.fsf@freebits.de> Message-ID: 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 From tcr at freebits.de Wed Sep 16 14:44:29 2009 From: tcr at freebits.de (Tobias C. Rittweiler) Date: Wed, 16 Sep 2009 16:44:29 +0200 Subject: [closer-devel] [PATCH] make defpackage form fully describe package's state References: <87skeoyyz8.fsf@freebits.de> <87k500yw3m.fsf@freebits.de> Message-ID: <87my4vosoi.fsf@freebits.de> Pascal Costanza writes: > 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. ;) Why shouldn't it? -T. From pc at p-cos.net Wed Sep 16 17:41:03 2009 From: pc at p-cos.net (Pascal Costanza) Date: Wed, 16 Sep 2009 19:41:03 +0200 Subject: [closer-devel] [PATCH] make defpackage form fully describe package's state In-Reply-To: <87my4vosoi.fsf@freebits.de> References: <87skeoyyz8.fsf@freebits.de> <87k500yw3m.fsf@freebits.de> <87my4vosoi.fsf@freebits.de> Message-ID: <756381E9-DA48-4198-B8FE-7F1710B4FC02@p-cos.net> On 16 Sep 2009, at 16:44, Tobias C. Rittweiler wrote: > Pascal Costanza writes: > >> 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. ;) > > Why shouldn't it? ...because in some versions of Closer to MOP for some Common Lisp implementations, I shadow and redefine things like defgeneric, defmethod, standard-generic-function, and the likes, which are also defined in the COMMON-LISP and CLOS packages of the respective implementations. Pascal -- Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net Vrije Universiteit Brussel Software Languages Lab Pleinlaan 2, B-1050 Brussel, Belgium