Subject: Re: Why I'm giving up on Lisp for now
From: rpw3@rpw3.org (Rob Warnock)
Date: Sun, 27 Jun 2004 00:43:18 -0500
Newsgroups: comp.lang.lisp
Message-ID: <aq-dnS6J-NDrw0Pd4p2dnA@speakeasy.net>
Peter Herth  <herth@netcologne.de> wrote:
+---------------
| Rob Warnock wrote:
| > - PATH and VALUE are still exported (and conflict with my ~/.cmucl-init).
| 
| Could you please describe your problems in detail ? These symbols are
| supposed to be exported (at least value, path is probably less useful
| for users) I experienced no conflicts with these symbols.
+---------------

[The following assumes the definition of CREATE-RECTANGLE has
been moved entirely into the LTK package, and EXPORTed...]

My "~/.cmucl-init" file contains (and has done, for several years)
local LET bindings for both PATH and VALUE (inside some personal
convenience functions), which means if I simply do a (USE-PACKAGE :LTK)
as in your examples, there's a conflict:

    > (load "ltk")

    ; Loading #p"/u/rpw3/ltk/ltk.x86f".
    T
    > (use-package :ltk)

    Error in function USE-PACKAGE:
       Use'ing package LTK results in name conflicts for these symbols:
    (VALUE PATH)

    Restarts:
      0: [CONTINUE] Unintern the conflicting symbols in COMMON-LISP-USER...
      1: [ABORT   ] Return to Top-Level.
    ...

Whereas if I shadow both PATH and VALUE, things work fine (since the
test code doesn't seem to need them to be visible from within USER):

    > (load "ltk")
    ; Loading #p"/u/rpw3/ltk/ltk.x86f".
    T
    cmu> (shadow '(path value))
    T
    cmu> (setf ltk::*wish-pathname* "wish8.3")
    "wish8.3"
    cmu> (load "foo")
    ; Loading #p"/u/rpw3/ltk/foo.lisp".
    T
    cmu> (gr-unit)
    canvas .w2 -width 300 -height 30
    text .w3 -width 20 -height 10
    puts [.w2 create rectangle 0 0 0 33]
    ...etc...

The other alternative [used in my previous reply] is to do
shadowing imports of PATH and VALUE before the USE-PACKAGE,
but that makes the previously-defined local symbols inaccessible
(though the functions using them continue to work, of course).

And on the third hand, the test harness code could simply
not do a USE-PACKAGE at all, and reference all of the Ltk
symbols explicitly [e.g. (LTK:WM-TITLE LTK:*TK* "Unit Test")].
They're only used in a handful of places, and that works
just fine, too.


-Rob

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