Skip to content

Multiple local nicknames for a single package lead to inconsistent behavior #549

Description

@scymtym

Adding multiple nicknames for a single package to another package, for example like this

(add-package-local-nickname "a" package2 package1)
(add-package-local-nickname "b" package2 package1)

leads to two kinds of inconsistent behavior. The first slight problem is that package2 is reported as being "nicknamed twice" by package1:

(package-locally-nicknamed-by-list "package2")
→ (#<Package "package1"> #<Package "package1">)

The second issue issue is that removing one of the local nicknames clears the locally nicknamed by list entirely:

(remove-package-local-nickname "b" "package1") → T
(package-locally-nicknamed-by-list "package2")
→ ()

I believe more consistent behavior would be like this (which is how SBCL behaves):

(add-package-local-nickname "a" package2 package1)
(add-package-local-nickname "b" package2 package1)
(package-locally-nicknamed-by-list "package2") → (#<Package "package1">)
(remove-package-local-nickname "b" "package1") → T
(package-locally-nicknamed-by-list "package2") → (#<Package "package1">)
(remove-package-local-nickname "a" "package1") → T
(package-locally-nicknamed-by-list "package2") → ()

I suggested adding a test for this behavior in this pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions