Skip to content

Package local nicknames: print-read consistency broken

(defun test-foo ()
  (eval `(defpackage :package-local-nicknames-test-1
           (:use)
           (:local-nicknames (:l :cl))))
  (let* ((*package* (find-package :package-local-nicknames-test-1))
         (*print-readably* t)
         (cons0 (read-from-string "L:CONS")))
    (prin1-to-string cons0)))

CL-USER> (test-foo)
"L:CONS" ;; SBCL
"CONS"   ;; ECL

According to the ECL manual: https://common-lisp.net/project/ecl/static/ecldoc/Extensions.html#Package-local-nicknames

When printing a package prefix for a symbol with a package local nickname, the local nickname is used instead of the real name in order to preserve print-read consistency.

This does not seem to occur here.

ECL develop (0ad38e2a) on linux64.