━━━━━━━━━━━━━━━━━━━━━━━━ PLN CDR DRAFT: ISSUE 1 Gleefre ━━━━━━━━━━━━━━━━━━━━━━━━ 1 Issue 1 (ADD-/REMOVE-PACKAGE-LOCAL-NICKNAME return values) ════════════════════════════════════════════════════════════ 1.1 Description ─────────────── Functions `add-package-local-nickname' and `remove-package-local-nickname' have inconsistent return values. The first one always returns the /designated package/, while the second one returns /true/ (a /generalized boolean/) that indicates whether a nickname was removed. Furthermore, there is no consensus among existing implementations as to what this /generalized boolean/ represents. In comparison,the functions `use-package' and `unuse-package' always return `T', and the functions `export' and `unexport' have the same behavior. There are also functions `unintern' and `delete-package' which return a /generalized boolean/ indicating if the operation changed something, but their counterparts `intern' and `make-package', unlike with local nicknames, create and return an /object/ (a /symbol/ or a /package/). 1.2 Examples ──────────── ┌──── │ (defpackage #:foo (:use)) │ (defpackage #:bar (:use)) │ │ (add-package-local-nickname '#:nick '#:bar '#:foo) │ ; => # (sbcl, ccl, ecl, acl, abcl, clasp, lispworks) │ (add-package-local-nickname '#:nick '#:bar '#:foo) │ ; => # (sbcl, ccl, ecl, acl, abcl, clasp, lispworks) │ (remove-package-local-nickname '#:nick '#:foo) │ ; => T (sbcl, ccl, ecl, acl, clasp) │ ; => # (abcl) │ ; => NIL (lispworks) │ (remove-package-local-nickname '#:nick '#:foo) │ ; => NIL (sbcl, ccl, ecl, acl, abcl, clasp, lispworks) └──── 1.3 Current behavior ──────────────────── sbcl, ccl, ecl, acl, abcl, clasp, lispworks: `add-package-local-nickname' always returns /designated package/. sbcl, ccl, ecl, acl, clasp: `remove-package-local-nickname' returns `T' if a nickname was removed, and `NIL' otherwise. abcl: `remove-package-local-nickname' returns /true/ if a nickname was removed, (more specifically, it returns the package nicknamed by the removed local nickname), and `NIL' otherwise. lispworks: `remove-package-local-nickname' always returns `NIL'. 1.4 Proposal ALWAYS-T ───────────────────── `add-package-local-nickname' should always return `T'. `remove-package-local-nickname' should always return `T'. 1.5 Proposal ELIMINATE-GENERALIZED-BOOLEAN ────────────────────────────────────────── `add-package-local-nickname' should return the /designated package/. `remove-package-local-nickname' should return `T' if a nickname was removed and `NIL' otherwise. 1.6 Proposal DESIGNATED-PACKAGE-IF-SUCCESSFUL ───────────────────────────────────────────── `add-package-local-nickname' should return the /designated package/ if a new nickname was added, and `NIL' otherwise. `remove-package-local-nickname' should return the /designated package/ if a nickname was removed, and `NIL' otherwise. 1.7 Proposal NICKNAMED-PACKAGE-IF-SUCCESSFUL ──────────────────────────────────────────── `add-package-local-nickname' should return the /nicknamed package/ if a new nickname was added, and `NIL' otherwise. `remove-package-local-nickname' should return the previously /nicknamed package/ if a nickname was removed, and `NIL' otherwise.