Re: Macros and symbols across packages



Kent M Pitman <pitman@xxxxxxxxxxx> writes:

> "Jeff M." <massung@xxxxxxxxx> writes:
>
>> Interesting. I didn't realize that symbol-name didn't also return the
>> package with the name when outside of the package (like print). I'll
>> give that a shot. Thanks.
>
> Return is the wrong verb here. Show is the correct verb.
>
> A symbol is, at least conceptually, a structure that always contains a
> name and a backpointer to the symbol's home package. Whether the
> printer decides to show the package depends on whether the symbol is
> accessible in the current package or only reachable by reference
> through a package. The package is always there, though, whether shown
> or not.
>
> The home package, incidentally, is only one of many packages the symbol
> might be accessible through. It's used when the symbol is not accessible
> locally if it is accessible through that home package. You can create
> pathological cases where you unintern it from its home package and it
> can't find a name to use for itself.


Let it be clear: SYMBOL-NAME _returns_ only the name of the symbol.
PRINT may or may not _print_ (show) the name of the package,
according to the value of various special variables.

--
__Pascal Bourguignon__ http://www.informatimago.com/
The rule for today:
Touch my tail, I shred your hand.
New rule tomorrow.
.



Relevant Pages

  • Re: macros
    ... The notation means that FOO doesn't have a home package, ... the situation of a symbol with no home package which is nevertheless ... Define a pkg package: ... Intern a new symbol foo in pkg; ...
    (comp.lang.lisp)
  • Re: macros
    ... The notation means that FOO doesn't have a home package, ... the situation of a symbol with no home package which is nevertheless ... Define a pkg package: ...   NIL ...
    (comp.lang.lisp)
  • Re: Understanding # and function variables
    ... Calling the second place "home package" is more strictly correct. ...
    (comp.lang.lisp)
  • Re: Macros and symbols across packages
    ... > package with the name when outside of the package. ... Show is the correct verb. ... The home package, incidentally, is only one of many packages the symbol ... Prev by Date: ...
    (comp.lang.lisp)
  • Re: read-from-string and packages
    ... the same package as the home package of the function's name symbol? ... to intern the symbols read, as specified by clhs intern, which is ...
    (comp.lang.lisp)