Re: [cmucl-imp] [cmucl-commit] CMUCL commit: src/code (package.lisp)
|From: Raymond Toy <rtoy@common-lisp.net> |Date: Sun, 26 Dec 2010 09:03:48 -0500 |MIME-Version: 1.0 |Content-Type: text/plain; charset="us-ascii" | | Date: Sunday, December 26, 2010 @ 09:03:48 | Author: rtoy | Path: /project/cmucl/cvsroot/src/code | |Modified: package.lisp | |Unintern removes the wrong symbol. See |https://bugs.launchpad.net/sbcl/+bug/693796. [It would be nice to have the whole relevant description in the repository, as part of the commit, instead of citing some website which may or may not be offline] I believe this patch would break the following use case which used to work earlier $ cat test.l (in-package "CL-USER") (eval-when (load eval compile) (when (find-package "FOO-PACKAGE") (delete-package "FOO-PACKAGE")) (when (find-package "BAR-PACKAGE") (delete-package "BAR-PACKAGE"))) (defpackage "FOO-PACKAGE" (:export "BAR-SYMBOL")) (defpackage "BAR-PACKAGE") (eval-when (load eval compile) (unintern 'foo-package:bar-symbol "FOO-PACKAGE")) (assert (not (find-symbol "BAR-SYMBOL" "FOO-PACKAGE"))) * (load (compile-file "test.l")) |Index: src/code/package.lisp |diff -u src/code/package.lisp:1.80 src/code/package.lisp:1.81 |--- src/code/package.lisp:1.80 Tue Apr 20 13:57:45 2010 |+++ src/code/package.lisp Sun Dec 26 09:03:48 2010 |@@ -1444,8 +1444,8 @@ | (remove symbol shadowing-symbols))) | | (multiple-value-bind (s w) (find-symbol name package) |- (declare (ignore s)) |- (cond ((or (eq w :internal) (eq w :external)) |+ (cond ((not (eq symbol s)) nil) |+ ((or (eq w :internal) (eq w :external)) | (nuke-symbol (if (eq w :internal) | (package-internal-symbols package) | (package-external-symbols package))
Madhu <madhu@cs.unm.edu> writes:
|From: Raymond Toy <rtoy@common-lisp.net> |Date: Sun, 26 Dec 2010 09:03:48 -0500 |MIME-Version: 1.0 |Content-Type: text/plain; charset="us-ascii" | | Date: Sunday, December 26, 2010 @ 09:03:48 | Author: rtoy | Path: /project/cmucl/cvsroot/src/code | |Modified: package.lisp | |Unintern removes the wrong symbol. See |https://bugs.launchpad.net/sbcl/+bug/693796.
[It would be nice to have the whole relevant description in the repository, as part of the commit, instead of citing some website which may or may not be offline]
I believe this patch would break the following use case which used to work earlier
$ cat test.l (in-package "CL-USER") (eval-when (load eval compile) (when (find-package "FOO-PACKAGE") (delete-package "FOO-PACKAGE")) (when (find-package "BAR-PACKAGE") (delete-package "BAR-PACKAGE"))) (defpackage "FOO-PACKAGE" (:export "BAR-SYMBOL")) (defpackage "BAR-PACKAGE") (eval-when (load eval compile) (unintern 'foo-package:bar-symbol "FOO-PACKAGE"))
(assert (not (find-symbol "BAR-SYMBOL" "FOO-PACKAGE")))
* (load (compile-file "test.l")) It breaks non-standard code, that is right.
-- With Best Regards, Stas.
|From: Stas Boukarev <stassats@gmail.com> |Cc: Raymond Toy <rtoy@common-lisp.net>, cmucl-imp@cons.org |Date: Sun, 26 Dec 2010 17:32:07 +0300 | |Madhu <madhu@cs.unm.edu> writes: | |> |From: Raymond Toy <rtoy@common-lisp.net> |> |Date: Sun, 26 Dec 2010 09:03:48 -0500 |> |MIME-Version: 1.0 |> |Content-Type: text/plain; charset="us-ascii" |> | |> | Date: Sunday, December 26, 2010 @ 09:03:48 |> | Author: rtoy |> | Path: /project/cmucl/cvsroot/src/code |> | |> |Modified: package.lisp |> | |> |Unintern removes the wrong symbol. See |> |https://bugs.launchpad.net/sbcl/+bug/693796. |> |> [It would be nice to have the whole relevant description in the |> repository, as part of the commit, instead of citing some website |> which may or may not be offline] |> |> I believe this patch would break the following use case which used to |> work earlier |> |> $ cat test.l |> (in-package "CL-USER") |> (eval-when (load eval compile) |> (when (find-package "FOO-PACKAGE") (delete-package "FOO-PACKAGE")) |> (when (find-package "BAR-PACKAGE") (delete-package "BAR-PACKAGE"))) |> (defpackage "FOO-PACKAGE" (:export "BAR-SYMBOL")) |> (defpackage "BAR-PACKAGE") |> (eval-when (load eval compile) |> (unintern 'foo-package:bar-symbol "FOO-PACKAGE")) |> |> (assert (not (find-symbol "BAR-SYMBOL" "FOO-PACKAGE"))) |> |> * (load (compile-file "test.l")) |It breaks non-standard code, that is right. The point of my example was to show that it breaks more than just non-stanadard code. It would be nice to keep misguided SBCL patches off the CMUCL codebase. -- Madhu
Madhu <madhu@cs.unm.edu> writes:
|From: Stas Boukarev <stassats@gmail.com> |Cc: Raymond Toy <rtoy@common-lisp.net>, cmucl-imp@cons.org |Date: Sun, 26 Dec 2010 17:32:07 +0300 | |Madhu <madhu@cs.unm.edu> writes: | |> |From: Raymond Toy <rtoy@common-lisp.net> |> |Date: Sun, 26 Dec 2010 09:03:48 -0500 |> |MIME-Version: 1.0 |> |Content-Type: text/plain; charset="us-ascii" |> | |> | Date: Sunday, December 26, 2010 @ 09:03:48 |> | Author: rtoy |> | Path: /project/cmucl/cvsroot/src/code |> | |> |Modified: package.lisp |> | |> |Unintern removes the wrong symbol. See |> |https://bugs.launchpad.net/sbcl/+bug/693796. |> |> [It would be nice to have the whole relevant description in the |> repository, as part of the commit, instead of citing some website |> which may or may not be offline] |> |> I believe this patch would break the following use case which used to |> work earlier |> |> $ cat test.l |> (in-package "CL-USER") |> (eval-when (load eval compile) |> (when (find-package "FOO-PACKAGE") (delete-package "FOO-PACKAGE")) |> (when (find-package "BAR-PACKAGE") (delete-package "BAR-PACKAGE"))) |> (defpackage "FOO-PACKAGE" (:export "BAR-SYMBOL")) |> (defpackage "BAR-PACKAGE") |> (eval-when (load eval compile) |> (unintern 'foo-package:bar-symbol "FOO-PACKAGE")) |> |> (assert (not (find-symbol "BAR-SYMBOL" "FOO-PACKAGE"))) |> |> * (load (compile-file "test.l")) |It breaks non-standard code, that is right.
The point of my example was to show that it breaks more than just non-stanadard code. It would be nice to keep misguided SBCL patches off the CMUCL codebase. The behaviour you expect from the code you showed is non-standard. And it behaves the same way in every implementation, except for CMUCL and SBCL.
-- With Best Regards, Stas.
|From: Stas Boukarev <stassats@gmail.com> |Date: Sun, 26 Dec 2010 17:40:07 +0300 |The behaviour you expect from the code you showed is |non-standard. I believe yet again that you are wrong. Explain what is non-standard. |And it behaves the same way in every implementation, except for |CMUCL and SBCL. Here I know you are wrong. -- Madhu
Madhu <madhu@cs.unm.edu> writes:
|From: Stas Boukarev <stassats@gmail.com> |Date: Sun, 26 Dec 2010 17:40:07 +0300
|The behaviour you expect from the code you showed is |non-standard.
I believe yet again that you are wrong. Explain what is non-standard.
|And it behaves the same way in every implementation, except for |CMUCL and SBCL.
Here I know you are wrong. I'm sorry, but this doesn't seem to be going anywhere. You can label me wrong all you want, I have no interest in persuading you otherwise.
-- With Best Regards, Stas.
|From: Stas Boukarev <stassats@gmail.com> |Date: Sun, 26 Dec 2010 18:05:16 +0300 |Madhu <madhu@cs.unm.edu> writes: | |> |From: Stas Boukarev <stassats@gmail.com> |> |Date: Sun, 26 Dec 2010 17:40:07 +0300 |> |> |The behaviour you expect from the code you showed is |> |non-standard. |> |> I believe yet again that you are wrong. Explain what is non-standard. |> |> |And it behaves the same way in every implementation, except for |> |CMUCL and SBCL. |> |> Here I know you are wrong. | |I'm sorry, but this doesn't seem to be going anywhere. You can |label me wrong all you want, I have no interest in persuading you |otherwise. You made the claim that the code I posted was non-standed. That claim is wrong. -- Madhu
On 12/26/10 9:40 AM, Stas Boukarev wrote:
Madhu <madhu@cs.unm.edu> writes:
|From: Stas Boukarev <stassats@gmail.com>
|> * (load (compile-file "test.l")) |It breaks non-standard code, that is right.
The point of my example was to show that it breaks more than just non-stanadard code. It would be nice to keep misguided SBCL patches off the CMUCL codebase. The behaviour you expect from the code you showed is non-standard. And it behaves the same way in every implementation, except for CMUCL and SBCL.
I'm getting confused now. (I would claim too much holiday cheer, but I didn't really drink anything much.) FIND-SYMBOL (before uninterning) says BAR-SYMBOL is an external symbol and not inherited. An external symbol is present in the package, according to the phrasing in the clhs entry for find-symbol. I do see that ccl and clisp fail the test. cmucl passes. Ray
Raymond Toy <toy.raymond@gmail.com> writes:
On 12/26/10 9:40 AM, Stas Boukarev wrote:
Madhu <madhu@cs.unm.edu> writes:
|From: Stas Boukarev <stassats@gmail.com>
|> * (load (compile-file "test.l")) |It breaks non-standard code, that is right.
The point of my example was to show that it breaks more than just non-stanadard code. It would be nice to keep misguided SBCL patches off the CMUCL codebase. The behaviour you expect from the code you showed is non-standard. And it behaves the same way in every implementation, except for CMUCL and SBCL.
I'm getting confused now. (I would claim too much holiday cheer, but I didn't really drink anything much.)
FIND-SYMBOL (before uninterning) says BAR-SYMBOL is an external symbol and not inherited. An external symbol is present in the package, according to the phrasing in the clhs entry for find-symbol.
I do see that ccl and clisp fail the test. cmucl passes. The problem is that the symbol is uninterned twice, and the second time it's uninterned it's passing a symbol with no home-package to unintern, which it surely can't find in that package anymore.
A better test-case: (progn (intern "SYM") (unintern (print 'sym)) (intern "SYM") (unintern (print 'sym)) (find-symbol "SYM")) => SYM #:SYM SYM :INTERNAL -- With Best Regards, Stas.
participants (3)
-
Madhu -
Raymond Toy -
Stas Boukarev