Re: Package nicknaming at :use time or reader time



"John Thingstad" <jpthing@xxxxxxxxx> writes:

Well :nick allows you to use short package names without causing conflict.
If short names conflict one has :shadow and :shadow-import.

Hmm. I cannot find :nick in the clhs page for defmacro. Am I missing
something, or did you mean :nicknames? If the latter, my problem there
was that the choice of nicks happens at package definition, rather
than package use.

Shadowing imports may help if one is lucky, but it still requires me
to choose one or the other - I can't access both without using the
fully qualified name, or a short name provided by the author of the
package.

(setf (symbol-function 'new-name) 'package:old-name) gives a function
a new local name.

This is true, but I am worried about it causing unintended
side-effects because it won't *be* the same symbol (for example,
suppose a package provides a macro that traverses a body of code
looking for calls to some particular function by checking symbol
equality, or by looking at other properties of the symbol).

In this regard I was hoping a read-time alias would provide the
desired semantics since the read data structure should be
indistinguishable from what you would have gotten had you typed out
the full name.

--
/ Peter Schuller

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@xxxxxxxxxxxx>'
Key retrieval: Send an E-Mail to getpgpkey@xxxxxxxxx
E-Mail: peter.schuller@xxxxxxxxxxxx Web: http://www.scode.org
.



Relevant Pages

  • Re: Why is this virus being detected?
    ... >>> I suspect that shadow copy runs as the 'Backup' user. ... >>> Nick ... >>> Virus Detected!!! ...
    (microsoft.public.windows.server.sbs)
  • Re: How to delete a Python package
    ... What's wrong with the "record" option of install: ... Maybe setup *should* support uninstall for consistant cross-platform ... Nick> into a package management system, ... Nick> package managers that do exactly that (rpm, deb, Windows ...
    (comp.lang.python)
  • Re: same symbol name in 2 different packages
    ... When you USE a package, ... But one can still do all that in DEFPACKAGE, which supports:SHADOW ... the conflict, giving preference to the package being defined: ...
    (comp.lang.lisp)
  • RE: Wonderful World of Linux 2.6 - Final
    ... I agree with Nick. ... Also the current scheduler does not distinguish idle logical CPU vs. ... idle package, having two active processes on the same package, leaving ...
    (Linux-Kernel)
  • Re: How to Easily Specify Export Symbol
    ... > I was developing my own little package shadowing some of LISP function ... reasonable way to do this would be to have your cl-oo package take the ... plus any defined in cl-oo (including the ones that shadow the cl base ...
    (comp.lang.lisp)