From: santas@inf.ethz.ch (Philip Santas)
Subject: Re: Pros and cons of C++
Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: Sat, 23 Jan 1993 22:54:02 GMT

In article <1993Jan22.155414.11675@midway.uchicago.edu> dave@alex.uchicago.edu (Dave Griffith) writes:
> santas@inf.ethz.ch (Philip Santas) writes:
>> dave@alex.uchicago.edu (Dave Griffith) writes:
>>>
>>>Nonsense.  In traditional subclassing, there is no concept of coercing to
>>>the superclass at all.  Coercions, if they occur, are utterly orthogonal to
>>>the subclassing heirarchy.  C++ implements this _very_ poorly (truncating
>>>objects if passed by value!) but calling this traditional inheritance is
>>>just wrong.
>>
>>I hope you are familiar with the terms "reference semantics" and "value semantics".
>>Coercions do occur when you move the object to the superclass in "value semantics".
>>Furthermore, you definitely coerce an object when you move it to the superclass,
>>since you alter its behaviour. If you don't believe me, make equality tests
>>on objects of differnt classes (which are at the same inheritance path).
>
>You're stuck in C++ here.  This is not the case in many other OO languages,
>and in only makes sense in C++ because of it's C roots showing through.  In
>Smalltalk and Eiffel, everything you describe would be just overly baroque 
>nonsense.

Smalltalk and Eiffel are not the only OOLs.
In Oberon for instance, this coercion is called ``projection''(as far as I remember).

Since you mentioned Smalltalk, if you send the message ``super'' to an object,
you change its behaviour, by calling the method from the superclass.

So much about "baroque nonsense"...

>A formal definition of Ada without concurrency took over six man years to
>produce (NYU, if I remember correctly).  Ada without concurrency is a 
>much simpler language than C++. Fewer types, fewer control primitives,
>less dynamism, less overriding. 

Ada does not have Inheritrance as OOLs have. The fact you mention, is _irrelevant_
to our case.

> As such, a decade seemed a reasonable
>time frame for a formal C++ defn.  You indicated that such a defn. would
>be the only argument you would accept. and I declined. 

You initially said that overloading of "=" (ie. coercions, constructors) in C++
increases the complexity. You did not document this.

I said that subclassing increases the complexity in the _same_ way, 
and coecrions do not increase it any further, since you
can view them as subclassing, or better, you can view subclassing as coercions:
you remove fields when you go to the superclass, or you use the identity function,
or you remove and/or redefine methods; all these are coercions.

In other terms, this is a problem for all the OOLs which support inheritance,
and not just of C++ as you originally stated.

You insisted that this is not the case. I have proved _my_ part. If you want
to refute my statements, _you_ have to bring valid arguments, or any valid proof for your
statements. Any other undocumented statement from your side (no matter in how _offencive_ way
you dress it) is pompous fairy-tail. Period.

Philip Santas

   "the bogosity in a field equals the bogosity imported from related areas, 
                  plus the bogosity generated internally,
    minus the bogosity expelled or otherwise disposed of."  - K. E. Drexler
--------------------------------------------------------------------------------
email: santas@inf.ethz.ch                                Philip Santas
Mail: Dept. Informatik                     Institute of Scientific Computation
      ETH Zurich                          Swiss Federal Institute of Technology
      CH-8092 Zurich                                  Zurich, Switzerland
      Switzerland
Phone: +41-1-2547478

Newsgroups: comp.lang.c++