From: Joerg-Cyril Hoehle
Subject: in-package CLtL1/CLtL2 compatibility help needed
Date: 
Message-ID: <2jb219$h0k@hermes.uni-konstanz.de>
Hi,

We wish to maintain a CLtL1/CLtL2 compatible set of utilities and
programs. Smaller utilities usually come in one file. I'd like to keep
it this way. Some utilities define their own package in this one file.

The problem now is that some CLtL1s Lisps expect the first form in
that file to be (in-package ...) for the compiler to know where to put
things. CLtL2 Lisps generate an error because the package hasn't been
defined yet.

I'm missing schemes about "how to do the right thing". Do you think
that the following is portable:

; -*- Mode: Lisp -*-
(unless (find-package "PACK") (make-package "PACK"))
(in-package "PACK")

...
;EOF

Thanks for your help,
 	Joerg Hoehle.
······@inf-wiss.uni-konstanz.de
From: Barry Margolin
Subject: Re: in-package CLtL1/CLtL2 compatibility help needed
Date: 
Message-ID: <2jggotINNjc8@early-bird.think.com>
In article <··········@hermes.uni-konstanz.de> ······@inf-wiss.uni-konstanz.de (Joerg-Cyril Hoehle) writes:
>I'm missing schemes about "how to do the right thing". Do you think
>that the following is portable:
>
>; -*- Mode: Lisp -*-
>(unless (find-package "PACK") (make-package "PACK"))
>(in-package "PACK")

It can fail if the initial package doesn't inherit from the LISP or
COMMON-LISP package.  The following should be more portable:

#+CLTL2
(common-lisp:in-package "COMMON-LISP")
#-CLTL2
(lisp:in-package "LISP")
(unless (find-package "PACK") (make-package "PACK"))
(in-package "PACK")
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar