Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!gatech!news.sprintlink.net!dorite!ts00-ind-20.iquest.net!user
From: fritza@iquest.net (Fritz Anderson)
Subject: Re: Modules (& Encapsulation)
Message-ID: <fritza-0306951851300001@ts00-ind-20.iquest.net>
Sender: news@dorite.use.com (News Admin)
Organization: Himself
References: <scgk.802047919@dcs.ed.ac.uk> <DERWAY.95Jun2103536@alumni.ndc.com>
Date: Sat, 3 Jun 1995 23:51:30 GMT
Lines: 30

In article <DERWAY.95Jun2103536@alumni.ndc.com>, derway@ndc.com (D. Erway)
wrote:

> Since Dylan and CLOS do not place the encapsulation around an object or a
> class, but around a module, I naively think I should put a class definition,
> and the methods that go with it in their own module.
> 
> But then, when I inherit from this class, across module boundaries, into a new
> class in its own module, the code for this new class likely needs access to
> the internals of the parent class.  Hopefully, these internals are not
> exported from the parent module.  Yet, the child module may need them.  For
> instance, in defining a new specialization on a generic function from the
> parent, the child is likely to need to diddle slots that are inherited from
> from the parent class.

Look at the streams library from Carneigie-Mellon.  (Working from memory
-- forgive the errors.)  There is a buffer module that implements the
buffer base class and its internals.  There is a buffer module for clients
that simply imports all the client-interface objects from the implentation
module and reexports them.  There is another module for buffer subclass
implementors that imports and reexports what in C++ would be the
"protected" interface.  You get different access to the buffer classes
depending on which submodule you use.

-- 
Fritz Anderson         Indianapolis, Indiana   317-257-2227
fritza@well.sf.ca.us   fritza@iquest.net       WT9T
I've begun to suspect that large portions of the Universe -- possibly
including history itself -- do not properly reward fair play, and I tell
you I'm pretty worked up about it.
