From: Giannandrea Castaldi
Subject: use package on the fly
Date: 
Message-ID: <c2srds$vpg$1@lacerta.tiscalinet.it>
Hi,
I want to use a package in cl-user, is there a way to 'import' a package 
  in the current package on the fly, without modifying the defpackage 
expression of the current package?
And another question, which is the difference between the modules that I 
can load with (require ...) and the packages?

Thanks.

Giannandrea

From: John Thingstad
Subject: Re: use package on the fly
Date: 
Message-ID: <opr4rgv0w0xfnb1n@news.chello.no>
(import 'cl-user)

On Fri, 12 Mar 2004 18:16:34 +0100, Giannandrea Castaldi 
<········@tiscali.it> wrote:

> Hi,
> I want to use a package in cl-user, is there a way to 'import' a package 
>   in the current package on the fly, without modifying the defpackage 
> expression of the current package?
> And another question, which is the difference between the modules that I 
> can load with (require ...) and the packages?
>
> Thanks.
>
> Giannandrea
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
From: Rudi Schlatte
Subject: Re: use package on the fly
Date: 
Message-ID: <m2vfl97r3z.fsf@Rudi-Schlattes-Computer.local>
Giannandrea Castaldi <········@tiscali.it> writes:

> Hi,
> I want to use a package in cl-user, is there a way to 'import' a
> package in the current package on the fly, without modifying the
> defpackage expression of the current package?

(in-package 'cl-user)  ;; just to make sure you're in it ...
(use-package 'some-package)

Now all exported symbols of `some-package' are accessible in cl-user.

> And another question, which is the difference between the modules that
> I can load with (require ...) and the packages?

That's the wrong question.  The right question is, is there any
guaranteed relationship between "modules" (defined as "whichever files
`require' happens to load") and packages?  The answer to that is no.
When you require something, the file(s) that are loaded can define
packages or not -- it's entirely up to them.

Hope that helps,

Rudi
From: Marco Antoniotti
Subject: Re: use package on the fly
Date: 
Message-ID: <N_M4c.101$IJ5.78738@typhoon.nyu.edu>
You want USE-PACKAGE.

Of course that may cause conflicts.  E.g.  suppose you have a package like

	(defpackage "INDUSTRIES" (:use) (:export "CAR" "FOOD" "WOOL"))

at the promopt you can do the following

	cl-prompt> *package*
	#<PACKAGE COMMON-LISP-USER>

	cl-prompt> (package-use-list "COMMON-LISP-USER")
	("#<PACKAGE COMMON-LISP> ...)

	cl-prompt> (use-package "INDISTRIES")
	===>  Error.  CL:CAR and INDUSTRIES:CAR conflict.

Cheers

Marco





Giannandrea Castaldi wrote:

> Hi,
> I want to use a package in cl-user, is there a way to 'import' a package 
>  in the current package on the fly, without modifying the defpackage 
> expression of the current package?
> And another question, which is the difference between the modules that I 
> can load with (require ...) and the packages?
> 
> Thanks.
> 
> Giannandrea
>