🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #149

Re: CLOS Stylistic Questions -- Program Structuring

#149
From: Clinton Hyde
Date: Wed, 19 Aug 1992 17:37
38 lines
2097 bytes
Hi Doug!

I personally prefer the DEFSYSTEM approach. i've been using it for 7+
years. if you are just a little careful about your code organization,
it's fairly easy to deal with. I have a simple guideline for what goes
where in the defsystem:

first module contains macros ONLY. this module must be compiled AND
loaded before continuing.

second module contains things like Classes ONLY. like compiled and
loaded. 

third module contains DEFVARs and SETQs of the defvars. if you just
use (DEFVAR *global-var*) or (DEFVAR *global-var* NIL "doc-string")
then a file of these things can precede module 1 or 2 if you want
macros or classes to use global symbols. otherwise, as module 3, the
defvars can be assigned make-instances of the classes.

fourth and subsequent modules can now use macros, classes, and
globals. I NEVER put macros, classes or DEFVARs anywhere except the
first three modules (generally, these are single files of the three
things). meta-. will find things for me with no trouble, so the could
get organized differently, but i've found this technique to be safest
for me over the years.

it keeps me out of trouble in case I forget the compile/load ordering
of the other modules.

 -- clint
--

Clint Hyde		"Give me a LispM or give me death!" -- anonymous

Advanced Decision Systems	Internet:  chyde@chesapeake.ads.com
2111 Wilson Blvd #800
Arlington, VA 22201		(703) 875-0327
Technical Details
Message-ID: <CHYDE.92Aug19123747@pecos.ads.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!mips!sdd.hp.com!elroy.jpl.nasa.gov!ames!ads.com!chesapeake.ads.com!chesapeake!chyde
References: <16eu8jINNhgp@agate.berkeley.edu> <DOUG.92Aug14161927@monet.ads.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!mips!sdd.hp.com!elroy.jpl.nasa.gov!ames!ads.com!chesapeake.ads.com!chesapeake!chyde
From: chyde@pecos.ads.com (Clinton Hyde)
Subject: Re: CLOS Stylistic Questions -- Program Structuring
In-Reply-To: doug@monet.ads.com's message of Sat, 15 Aug 1992 00:19:27 GMT
Message-ID: <CHYDE.92Aug19123747@pecos.ads.com>
Lines: 38
Sender: usenet@chesapeake.ads.com (USENET News)
Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
 960-7300
References: <16eu8jINNhgp@agate.berkeley.edu>
 <DOUG.92Aug14161927@monet.ads.com>
Date: Wed, 19 Aug 1992 17:37:47 GMT