Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!newsfeed.rice.edu!news.sesqui.net!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!cam-news-hub1.bbnplanet.com!howland.erols.net!EU.net!uknet!usenet1.news.uk.psi.net!uknet!uknet!bcc.ac.uk!link-1.ts.bcc.ac.uk!ucapcjw
From: ucapcjw@ucl.ac.uk (Dr Channing J Walton)
Subject: Re: Help needed in understanding isInteger or isFloat etc
Sender: news@ucl.ac.uk (Usenet News System)
Message-ID: <1997Jan23.112027.63568@ucl.ac.uk>
Date: Thu, 23 Jan 1997 11:20:27 GMT
References: <32E6380E.30AB@eleceng.ucl.ac.uk> <32E66BBF.35C9@parcplace.com>
Organization: Bloomsbury Computing Consortium
Lines: 23

In article <32E66BBF.35C9@parcplace.com> clayberg@parcplace.com writes:
>Bo Cai wrote:
>> Heres my problem:  if I tested for 'aNumber isComplex' and aNumber
>> wasn't, I got an error because Float or integer didn't understand.
>> Why is this, because I can do tests like '1 isFloat' with no error, or
>> '1.0 isInteger'.
>
>Did you implement a Number>>isComplex method to return false (as well as
>a Complex>>isComplex to return true)? Without that, other "numbers" wont
>understand the #isComplex message. The #isFloat and #isInteger protocols
>are already defined by the base image so those work fine.
>
>-Eric

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 ?

ta.

channing
ps. (Bo Cai did not send the original article - netscape news problem)

