Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!ee.udel.edu From: new@ee.udel.edu (Darren New) Newsgroups: comp.lang.smalltalk Subject: Re: method-ology Message-ID: <57061@nigel.ee.udel.edu> Date: 24 Jun 91 18:24:35 GMT References: Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 25 Nntp-Posting-Host: estelle.ee.udel.edu In article voss@cs.uiuc.edu (Bill Voss) writes: > Programmers who anticipate that as unlikely as it seems today, >somebody might someday subclass MyMatrix write: > | tmpQ tmpR | > tmpQ := theMatrix class new. > tmpR := theMatrix class new. > theMatrix q: tmpQ r: tmpR. And those who have been screwed by somebody else's code that gets it wrong :-), might code tmpQ := theMatrix species new. tmpR := theMatrix species new. This would allow subclases which have specialized internal representations (e.g., a Toplitz (sp?) matrix) to return a normal matrix when the invariant of which the internal representation is based changes. See, for example, the Interval class, whose species is Array (since adding or removing on an interval may not continue to yield something that can be represented as a start/stop/step tuple. -- Darren -- --- Darren New --- Grad Student --- CIS --- Univ. of Delaware --- ----- Network Protocols, Graphics, Programming Languages, FDTs ----- +=+ Nails work better than screws, when both are driven with hammers +=+