creating Complex
Jarvis, Robert P.
Jarvisb at timken.com
Tue Mar 23 15:41:50 UTC 1999
Where can I pick up a Complex number class for Squeak? Was this in the
updates since 2.3 (haven't gotten them - the firewall is my shepherd, I
shall be safe no matter what)?
Bob Jarvis
The Timken Company
> -----Original Message-----
> From: Bert Freudenberg [SMTP:bert at isgnw.CS.Uni-Magdeburg.De]
> Sent: Tuesday, March 23, 1999 10:07 AM
> To: squeak at cs.uiuc.edu
> Subject: Re: creating Complex
>
> On Tue, 23 Mar 1999, SLAWICK CHARLIER wrote:
>
> > I am a new squeak user (I use squeak to learn object oriented
> > programming).
> > To learn programming smalltalk, I actulally try to create a complex
> number
> > class. I've got a little problem: I want the programm to create a
> complex
> > when writing the command:
> > 5+4i
> > (for example); I've tried to add a method to the superclass 'number' but
> I
> > can't name it '+i' or '+ t1 i'...
> > Is there a way for me to deal with this problem?...
>
> You can implement 'i' in Number returning a Complex with a real part of
> zero. Then '5 + 4 i' would be 'Number + Complex' which should yield
> another Complex by proper coercion (see Number's class comment).
>
> /bert
>
> --
> Bert Freudenberg Departement of
> Simulation and
> mailto:bert at isg.cs.uni-magdeburg.de Computer Graphics
> http://isgwww.cs.uni-magdeburg.de/isg/bert.html Univ. of Magdeburg
>
More information about the Squeak-dev
mailing list
|