Re: Organizing code with CLOS
- From: Kenny Tilton <NOktiltonSPAM@xxxxxxxxxx>
- Date: Mon, 27 Feb 2006 16:03:20 GMT
Jonathon McKitrick wrote:
Do you guys generally put class definitions and generics in one file,
and defmethods in another? Or lump them all together?
I do not write defgeneric unless I have to (non-std method combo).
Otherwise, sometimes methods go after their classes, sometimes they all go together in a separate file dedicated to a subset of the functionality built around the classes.
Elsewhere you asked:
My current project is steadily growing, and recent interest by potential customers has
made it pretty clear the growth is going to continue. I've found myself several times
readjusting directory layout, filenames, asdf, and so on.
Yes, upheavals are fun.
Learn about pathnames and even <gasp!> logical pathnames. That will let you mess with directory structure least painfully.
Is there a standard approach you have found that works well for organizing (within a
given module) code according to classes, macros, implementation, misc, utilities, and all
that? One that grows well, is easy to maintain, and works well with CL?
Divide the code into packages along whatever sensible functional lines you see, the sooner the easier. Each package gets its own subdirectory. If you have enough code, this will lead to refactoring because you will find using code requiring access to package internals. Not good. So you stare at it and extend the API so the using code can stay out of the package. Stuff like that.
Classes /must/ precede methods specialized on them, and macros must precede any use, so that gives you some clues.
Otherwise, I keep my source files small and just divide up functionality along sensible lines of grouping and do not worry about it much.
kt
.
- Follow-Ups:
- Re: Organizing code with CLOS
- From: Peter Seibel
- Re: Organizing code with CLOS
- References:
- Organizing code with CLOS
- From: Jonathon McKitrick
- Organizing code with CLOS
- Prev by Date: Re: Organizing code with CLOS
- Next by Date: Re: Organizing code with CLOS
- Previous by thread: Re: Organizing code with CLOS
- Next by thread: Re: Organizing code with CLOS
- Index(es):
Relevant Pages
|
|