[comp.object] complex number example

sakkinen@tukki.jyu.fi (Markku Sakkinen) (02/01/90)

This is connected with a criticism of Grogono and Bennett's paper
"Polymorphism and Type Checking in Object-Oriented Languages"
in the November 1989 issue of SIGPLAN Notices, specifically
with their suggestion on handling alternative representations
of complex numbers.

I have read in some book or article an example in which a Complex object
(implementing complex numbers) contained both the Cartesian
and the polar representation and a validity indicator for each:
at every moment, at least one representation must be valid,
and even both can be. If memory serves, it was a well-done example.
The only problem is that I don't remember where it was.

My previous quest for a lost reference yielded very good results.
I am again asking for some kind person who does remember where
this example was presented, to mail me the exact reference.
Thank you in advance!

Markku Sakkinen
Department of Computer Science
University of Jyvaskyla (a's with umlauts)
Seminaarinkatu 15
SF-40100 Jyvaskyla (umlauts again)
Finland

sakkinen@tukki.jyu.fi (Markku Sakkinen) (02/02/90)

My question was answered immediately. (Why, I thought I had searched
a bit for this example in my copy of OOSC before I lent it ...)

From: wright@hsi.com (Gary Wright)
Bertrand Meyer in Object-Oriented Software Construction on page 136
gives an example that seems to be what you are describing.

Information confirmed by:
From: Jacob Gore <jacob@blackbox.gore.com>
From: Max Hailperin <max@Neon.Stanford.EDU>
From: tynor@prism.gatech.edu (Steve Tynor)

Thank you all (including those whose answer may be on its way)!

Markku Sakkinen
Department of Computer Science
University of Jyvaskyla (a's with umlauts)
Seminaarinkatu 15
SF-40100 Jyvaskyla (umlauts again)
Finland

kim@helios.enea.se (Kim Wald`n) (02/03/90)

In article <2904@tukki.jyu.fi> sakkinen@tukki.jyu.fi (Markku Sakkinen) writes:

>   I have read in some book or article an example in which a Complex object
>   (implementing complex numbers) contained both the Cartesian
>   and the polar representation and a validity indicator for each:
>   at every moment, at least one representation must be valid,
>   and even both can be. If memory serves, it was a well-done example.
>   The only problem is that I don't remember where it was.

You probably refer to the example in Bertrand Meyers "Object-Oriented
Software Construction", pp. 136-139.

-- Kim Walden
Enea Data, Sweden
kim@enea.se