Subject: Re: On the use of packages
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 18 Oct 2007 23:14:01 -0500
Newsgroups: comp.lang.lisp
Message-ID: <ipOdnYHIa7mUsoXanZ2dnUVZ_v2unZ2d@speakeasy.net>
Pillsy  <pillsbury@gmail.com> wrote:
+---------------
| pm, Josip Gracin <gra...@tel.fer.hr> wrote:
| > Edi Weitz wrote:
| > > Cross the bridge when you come to it.
| > 
| > I guess I could get used to that tactic.  It's not like conflict could
| > go unnoticed.  So, simply :using packages until something gives and then
| > resolve the conflict by not :using one of the conflicting packages.
...
| The package system is more finely grained than that. You can, for
| instance, use the :SHADOW option for DEFPACKAGE to ensure that
| specific symbols aren't imported from a package you're using. You can
| also use :IMPORT-FROM to bring in specific symbols from a package
| instead of using the whole thing, and so on.
+---------------

Indeed. Here's a little snippet of boilerplate I find myself using
whenever I play around with CLX while in the CL-USER package:  ;-}

    (require :clx)
    #+cmu (shadow 'define-keysym)
    #+clisp (shadowing-import 'xlib:char-width)
    (use-package :xlib)

+---------------
| You should definitely read the relevant section of the CLHS:
| http://www.lisp.org/HyperSpec/Body/mac_defpackage.html
+---------------

And note especially the difference between the :SHADOW & :SHADOWING-IMPORT
options, and compare with the SHADOW & SHADOWING-IMPORT functions:

    http://www.lisp.org/HyperSpec/Body/fun_shadow.html
    http://www.lisp.org/HyperSpec/Body/fun_shadowing-import.html


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607