Bruno Burke <
bruno...@googlemail.com> writes:
> When I use (use-package "CL-GD") I get this error:
> Using #<Package "CL-GD"> in #<Package "COMMON-LISP-USER">
> would cause name conflicts with symbols already present in that package:
> *DEFAULT-IMAGE* CL-GD:*DEFAULT-IMAGE*
> THICKNESS CL-GD:THICKNESS
>
> So it seems, that these symbols are already defined in my User
> Package?
Yes, since you had your REPL read a symbol named "*DEFAULT-IMAGE*" by
typing *default-image* at it, it has interned a symbol named
"*DEFAULT-IMAGE* in the package COMMON-LISP-USER (which is the default
current package).
And now you're asking it to add to the use list of the COMMON-LISP-USER
package a package that exports a symbol with the same name!
Make up your mind!
Do you want COMMON-LISP-USER:*DEFAULT-IMAGE* or CG-GD:*DEFAULT-IMAGE*?
Which one will it be?
Do you expect the lisp system to know what you intend?
Perhaps you're expecting it to know what you will be programming next?
Perhaps you can just go home and let it do your work instead of you?
> If I use (in-package "cl-gd") it works without an error / but I think
> in-package is intended to be used if i want to extend the
> functionality of cl-gd // but thats not what i want, I only want to
> use its functions.
Interactively, when you have those conflicts, there are usually restarts
that let you choose what to do to resolve them.
If common-lisp-user:*default-image* was an error, then just select the
restart that will unintern it, and use the cl-gd package.
When you program you would use the cl-gd package in your own package, so
it should already know what symbol *default-image* names.
(defpackage "MY-PROGRAM"
(:use "COMMON-LISP" "CL-GD"))
(in-package "MY-PROGRAM")
(find-package '*default-image*) --> #<PACAKGE CL-GD>