Suppose I want to find out in which package a class is defined, e.g. say (defclass x ()()) is defined in p1. One way could be to get the package via (symbol-package 'x). the problem with this solution is that x is exported in a different package p2. Any other suggestions?
相关问题
- Generating powerset in one function, no explicit r
- Drakma and Dexador both fails at USocket call whil
- Error when installing TDA package on R
- installing packages for python 3
- How do I build a debian package whose sources incl
相关文章
- unable to install packages(“caret”) completely in
- Does learning one Lisp help in learning the other?
- Common Lisp: Why does my tail-recursive function c
- PHP friend/package visibility
- What is the definition of “natural recursion”?
- How do I write a macro-defining macro in common li
- How can I unintern a qualified method?
- Ubuntu graphviz 'sfdp' not working
As Rainer Joswig said, classes aren't defined in packages; symbols have packages and the name of a class is a symbol.
If you want to know the value of
*PACKAGE*
at the time the class definition read, compiled, or loaded (which could conceivably be three different values), I do not believe there is any way to retrieve that unless you write code to store it at that time.Furthermore, it doesn't seem like a meaningful piece of information to have. A package is simply a namespace for symbols, and there's no reason the package that was current at the time the class definition was read, compiled, or loaded should have anything to do with the class itself.
However, if what you really want is for the name of the class x to reside in a package p1, but p2 exports it, you may be interested in adding x to the shadow list of p1 in its defpackage form (or after).