From: T. V. Raman
Subject: Defsystem: Is this is a feature or a bug?
Date: 
Message-ID: <1992Aug23.130346.22483@cs.cornell.edu>
Hi!

I am using defsystem to build a system that is made up of several
other systems.

Each subsystem has its own package and these systems have also been
defined using defsystem, and the dependencies correctly declared. 

I have: 

Main system MAIN which depends on SUB1 SUB2 SUB3.

SUB(i) have their own packages.

SUB1 itself has sub11 as a subsystem and sub11 has its own package. 

The system definition for each of the systems contains a line at the
top of the file of the form

(unless (find-package ..) (make-package ..)) for that particular
system. 

With the above setup if I do:
(load-system 'main)

I get the following error:
package sub1 is not valid: supply a new package.

The problem disappears if I put the lines

(unless (find-package sub1) (make-package ..) )  along  with similar
declarations for sub2 sub3 and sub11 in the file main.system

I feel that this is uncalled for since main.system should be loading
sub1.system and not expect to see the package declaration for sub1
before this time.

All explanations/tips welcome, maybe there is a good reason why
defsystem does the above.

--Raman
-- 
   T. V. Raman <·····@cs.cornell.edu>Tel: (607)255-9202  R 272-3649
                       Office: 4116 Upson Hall,
Department of Computer Science, Cornell University Ithaca NY 14853-6201
                Res: 226 Bryant Avenue Ithaca NY 14850

From: Stephen M Jameson
Subject: Re: Defsystem: Is this is a feature or a bug?
Date: 
Message-ID: <1992Aug26.163927.16225@puma.ATL.GE.COM>
[***]
>With the above setup if I do:
>(load-system 'main)
>
>I get the following error:
>package sub1 is not valid: supply a new package.
>
[***]
>All explanations/tips welcome, maybe there is a good reason why
>defsystem does the above.
>
>--Raman
>-- 

You do not indicate what Lisp you are using.  If you are using a Symbolics, I
would guess that the problem is that the file sub1.system (or whatever the
system declaration file is) has ";;; -*- ... Package:  SUB1" in the header
line, and as soon as it tries to read the file, it complains about the lack of
this package.  As someone else has pointed out (probably barmar), all system
and package declaration files should be created and read in the USER package.
If you are not using a Lispm, I would need more information.  

Good luck.

-- 
Steve Jameson                           General Electric Aerospace 
········@atl.ge.com                     Advanced Technology Laboratories
                                        Moorestown, New Jersey              
****************************************************************************
From: T. V. Raman
Subject: Re: Defsystem: Is this is a feature or a bug?
Date: 
Message-ID: <1992Aug27.161401.6984@cs.cornell.edu>
········@atl.ge.com (Stephen M Jameson) writes:

>[***]
>>With the above setup if I do:
>>(load-system 'main)
>>
>>I get the following error:
>>package sub1 is not valid: supply a new package.
>>
>[***]
>>All explanations/tips welcome, maybe there is a good reason why
>>defsystem does the above.
>>
>>--Raman
>>-- 

>You do not indicate what Lisp you are using.  If you are using a Symbolics, I
>would guess that the problem is that the file sub1.system (or whatever the
>system declaration file is) has ";;; -*- ... Package:  SUB1" in the header
>line, and as soon as it tries to read the file, it complains about the lack of
>this package.  As someone else has pointed out (probably barmar), all system
>and package declaration files should be created and read in the USER package.
>If you are not using a Lispm, I would need more information.  

I am using lucid common lisp 4.1 on a sparc station with the defsystem
available from cmu in the lisp-utilities directory.

Thanks,
>Good luck.

>-- 
>Steve Jameson                           General Electric Aerospace 
>········@atl.ge.com                     Advanced Technology Laboratories
>                                        Moorestown, New Jersey              
>****************************************************************************
-- 
   T. V. Raman <·····@cs.cornell.edu>Tel: (607)255-9202  R 272-3649
                       Office: 4116 Upson Hall,
Department of Computer Science, Cornell University Ithaca NY 14853-6201
                Res: 226 Bryant Avenue Ithaca NY 14850
From: Mark Kantrowitz
Subject: Re: Defsystem: Is this is a feature or a bug?
Date: 
Message-ID: <Btnw4H.Gwn.1@cs.cmu.edu>
T. V. Raman writes:
> With the above setup if I do:
> (load-system 'main)
>
> I get the following error:
>     package sub1 is not valid: supply a new package.
>
> All explanations/tips welcome, maybe there is a good reason why
> defsystem does the above.
>
> I am using lucid common lisp 4.1 on a sparc station with the defsystem
> available from cmu in the lisp-utilities directory.

When a package is specified as part of a system, the current version
of defsystem uses IN-PACKAGE to switch to the package. This will not
work correctly in a CLtL2-compliant Lisp, since IN-PACKAGE no longer
creates the package if it doesn't already exist. I would recommend
placing the defpackage forms in a file which is loaded at the
beginning of the system (e.g., all the rest of the files in the system
depend on it), and placing appropriate IN-PACKAGE forms in the
beginning of each file of the system.

--mark
From: Pete Grant
Subject: Re: Defsystem: Is this is a feature or a bug?
Date: 
Message-ID: <1992Aug27.005611.20462@pentagon-gw.army.mil>
In article <······················@cs.cornell.edu> ·····@cs.cornell.edu (T. V. Raman) writes:
>
>Hi!
>
>I am using defsystem to build a system that is made up of several
>other systems.
>
>Each subsystem has its own package and these systems have also been
>defined using defsystem, and the dependencies correctly declared. 
>
>I have: 
>
Without seeing the files, it's hard to diagnose, but one possibility
is that your defsystem file is in the package for your system.

Usually the defsystem file header should be in package user.  If 
that's not the case, use m-X Set Package ZMACS command.

If that's not the culprit, check for references to the package before
its declaration.

Hope this helps.

Pete.
>Main system MAIN which depends on SUB1 SUB2 SUB3.
>
>SUB(i) have their own packages.
>
>SUB1 itself has sub11 as a subsystem and sub11 has its own package. 
>
>The system definition for each of the systems contains a line at the
>top of the file of the form
>
>(unless (find-package ..) (make-package ..)) for that particular
>system. 
>
>With the above setup if I do:
>(load-system 'main)
>
>I get the following error:
>package sub1 is not valid: supply a new package.
>
>The problem disappears if I put the lines
>
>(unless (find-package sub1) (make-package ..) )  along  with similar
>declarations for sub2 sub3 and sub11 in the file main.system
>
>I feel that this is uncalled for since main.system should be loading
>sub1.system and not expect to see the package declaration for sub1
>before this time.
>
>All explanations/tips welcome, maybe there is a good reason why
>defsystem does the above.
>
>--Raman
>-- 
>   T. V. Raman <·····@cs.cornell.edu>Tel: (607)255-9202  R 272-3649
>                       Office: 4116 Upson Hall,
>Department of Computer Science, Cornell University Ithaca NY 14853-6201
>                Res: 226 Bryant Avenue Ithaca NY 14850