Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.tc.cornell.edu!news3.cac.psu.edu!howland.erols.net!EU.net!uknet!usenet1.news.uk.psi.net!uknet!uknet!bcc.ac.uk!news
From: Channing Walton <cwalton@eleceng.ucl.ac.uk>
Subject: Re: Help needed in understanding isInteger or isFloat etc
Sender: news@ucl.ac.uk (Usenet News System)
Message-ID: <32E897F5.4081@eleceng.ucl.ac.uk>
Date: Fri, 24 Jan 1997 11:07:33 GMT
Reply-To: cwalton@ee.ucl.ac.uk
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
References: <32E6380E.30AB@eleceng.ucl.ac.uk> <32E66BBF.35C9@parcplace.com> <1997Jan23.112027.63568@ucl.ac.uk> <32E79F53.24B8@parcplace.com>
Mime-Version: 1.0
X-Mailer: Mozilla 2.0 (Macintosh; I; 68K)
Organization: University College London
Lines: 16

Eric Clayberg wrote:
> 
> Dr Channing J Walton wrote:
> > I see. I currently have an isComplex method which simply returns true
> > because I was copying from the Fraction class since it seemed similar
> > in that it has two fields.  Must I actually write a new method in the Number
> > class called isComplex ?
> 
> Yes. All numbers, in general, should respond false to the message
> #isComplex. Your Complex class should then override the #isComplex
> method in Number in order to return true. Look at the implementors of
> #isInteger or #isFloat for examples.
> 
> -Eric

Ok, thanks for the help - I will try the things you have suggested

