[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue: IN-PACKAGE-FUNCTIONALITY (Version 1)



    Date: Mon, 26 Sep 88 23:41 EDT
    From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>

    ... Even if DEFPACKAGE is not adopted, I still favor
    IN-PACKAGE-FUNCTIONALITY:SELECT-ONLY, in spite of the proposal's
    claim to depend on DEFPACKAGE; MAKE-PACKAGE could be used instead.

Well, one issue is that we need something that will be processed at
compile time. Replacing

 (IN-PACKAGE 'FOO) ;Current semantics

with

 (MAKE-PACKAGE 'FOO)
 (IN-PACKAGE 'FOO) ;New semantics

will not do because (at least in Genera and I bet in other implementations
as well), MAKE-PACKAGE signals an error if the package already exists.
If you write:

 (UNLESS (FIND-PACKAGE 'FOO) (MAKE-PACKAGE 'FOO))
 (IN-PACKAGE 'FOO) ;New semantics

you lose because the IF isn't processed at compile time and the IN-PACKAGE
will say no such package at compile time. You have to write

 (EVAL-WHEN (EVAL COMPILE LOAD)
   (UNLESS (FIND-PACKAGE 'FOO) (MAKE-PACKAGE 'FOO)))
 (IN-PACKAGE 'FOO)

which I find a little on the ugly side.

Technically you're right that MAKE-PACKAGE is enough, but stylistically
IN-PACKAGE was convenient because it was so much less obscure. If DEFPACKAGE
doesn't come in, some might think we're causing them a hassle. I dunno...

For now I think I'll just cross my fingers for DEFPACKAGE being adopted and
hope this issue will become moot.