[Ecls-list] inexistant packages

Pascal J. Bourguignon pjb at informatimago.com
Sun Aug 29 23:36:54 UTC 2010



It looks like the ecl reader will create automatically hidden package
when reading qualified symbols naming inexistant packages.

I can't find anything in CLHS that prevents this behavior, but it's
highly unexpected.


It just made me lose one hour on a typo.



I think this 'feature' should be optional (off by default), and be
documented as an extension to Common Lisp, if not removed at all.

It is problematic that no error is signaled when reading a symbol from
an inexisting package.

It may also be problematic that when creating a package, it may
already contain all the symbols read with this package qualification.



$ ecl
ECL (Embeddable Common-Lisp) 10.7.1
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.  
Top level in: #<process SI:TOP-LEVEL 0000000000643f60>.
> '(user-input::a)

(USER-INPUT::A)
> (list-all-packages)

(#<"FFI" package> #<"GRAY" package> #<"MP" package> #<"CLOS" package>
 #<"SI" package> #<"KEYWORD" package> #<"COMMON-LISP-USER" package>
 #<"COMMON-LISP" package>)
> (find-package "USER-INPUT")

NIL
> (symbol-name (first '(user-input::a)))

"A"
> (symbol-package (first '(user-input::a)))

#<"USER-INPUT" package>
> (find-package "USER-INPUT")

NIL
> (eq 'user-input::a 'user-input::a)

T
> (defvar *a* 'user-input::a)

*A*
> (eq *a* 'user-input::a)

T
> (list-all-packages)

(#<"FFI" package> #<"GRAY" package> #<"MP" package> #<"CLOS" package>
 #<"SI" package> #<"KEYWORD" package> #<"COMMON-LISP-USER" package>
 #<"COMMON-LISP" package>)

> (defpackage "USER-INPUT")

#<"USER-INPUT" package>
> *a*

USER-INPUT::A
> (list-all-packages)

(#<"USER-INPUT" package> #<"FFI" package> #<"GRAY" package> #<"MP" package>
 #<"CLOS" package> #<"SI" package> #<"KEYWORD" package>
 #<"COMMON-LISP-USER" package> #<"COMMON-LISP" package>)
> (find-symbol "A" (find-package "USER-INPUT"))

USER-INPUT::A
:INTERNAL
> (eq *a* (find-symbol "A" (find-package "USER-INPUT")))

T
> 


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/




More information about the ecl-devel mailing list