Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!mcsun!sunic!tut!tukki!sakkinen From: sakkinen@tukki.jyu.fi (Markku Sakkinen) Newsgroups: comp.lang.smalltalk Subject: Re: Processor objects vs. data objects Message-ID: <1258@tukki.jyu.fi> Date: 1 Sep 89 08:10:24 GMT References: <57069@aerospace.AERO.ORG> Reply-To: markku@jytko.jyu.fi (Markku Sakkinen) SAKKINEN@FINJYU.bitnet (alternative) Organization: University of Jyvaskyla, Finland Lines: 34 In article <57069@aerospace.AERO.ORG> abbott@itro3.aero.org (Russell J. Abbott) writes: - -Since *anything* can be an object there is nothing to prevent one from -building processor objects that parallel traditional subprograms. For -example one could define a SquareRoot class whose instances would be -objects with a single defined method squareRoot: aNumber. - - SquareRoot new squareRoot: 4 - -would return 2. - ... You don't need _instances_ at all to accomplish this kind of thing: define "squareRoot" as a _class_ method so you can simply say SquareRoot squareRoot: 4 Or define a "MathFunctions" class that has both "squareRoot" and other class methods. Disclaimer: I am not a Smalltalk expert, apologies if this is a standard way of programming that almost everybody in the ST community uses when appropriate. Lynn Stein's paper, "Inheritance Is Delegation" (OOPSLA'87), makes one realise that classes (that is, ordinary classes, not metaclasses) are the most important and most powerful objects in Smalltalk-80. Markku Sakkinen Department of Computer Science University of Jyvaskyla (a's with umlauts) Seminaarinkatu 15 SF-40100 Jyvaskyla (umlauts again) Finland