Re: Help with packages
- From: tar@xxxxxxxxxxxxx (Thomas A. Russ)
- Date: 12 Sep 2008 18:50:15 -0700
vttoonses <vttoonses@xxxxxxxxx> writes:
As to question number 3, are you saying that each symbol that I wish
to use from outside the package implementation file(s) needs to be
exported explicitly?
Correct.
Exporting a class name only allows the creation
of the class (without the '::' syntax) not access to the accessor/
reader/writer methods, correct? (I'm assuming this is due to the
separation of data and behavior in the CLOS).
No, the assumption is incorrect.
Exporting applies only to SYMBOLs. It has nothing to do with classes,
slots, CLOS or anything else. Packages manage only namespaces and not
any other elements of Lisp code.
So if you have a class and a function named "FOO", then exporting the
symbol FOO means that both
(make-instance 'my-package:foo)
and
(my-package:foo ...)
can be invoked without needing to use the double colons.
Packages in lisp are only there to prevent accidental namespace
collisions. They do not purport to provide any measure of data or
implementation hiding. (As the ability to access internal symbols of
packages demonstrates.)
--
Thomas A. Russ, USC/Information Sciences Institute
.
- References:
- Help with packages
- From: vttoonses
- Re: Help with packages
- From: Tamas K Papp
- Re: Help with packages
- From: vttoonses
- Help with packages
- Prev by Date: Re: What do you LISPers think of Haskell?
- Next by Date: did franz open source the common lisp dns server?
- Previous by thread: Re: Help with packages
- Next by thread: Re: Help with packages
- Index(es):
Relevant Pages
|
|