division of objects into classes and structures is bad

Weed resume755 at mail.ru
Mon Jan 5 22:25:14 PST 2009


Christopher Wright пишет:
> Weed wrote:
>> Who agrees with me? There are still ideas as it is possible to solve
>> this problem and not to destroy language?
> 
> When you reply to your reply to your reply to your post and nobody else
> replies to any of your posts, you might start thinking that nobody
> agrees with you, or cares enough to respond.

I consoled myself that the letter has got lost in the big thread

> As to your suggestion that there be compile-time checks for object
> slicing... well, you'd end up with almost everything with any
> polymorphism being done by reference for safety. In the remaining
> situations, scope will usually suffice.
> 
> I don't think anyone sees sufficient reason to give Walter as much work
> as you suggest.

D2.0 not released, it changes supplemented. I seriously consider at it
there is a chance to become the most good language, a "silver bullet".
:) This discussion - my small contribution.

> When would you use this?
>  - In place of the current scope keyword.

I consider that "scope" is attempt to fix bad design.
Have come to that that on a stack all the same it is necessary to place
classes and have added a word, but it does not solve all problems.

>  - For more efficiency with object composition (though scope could be
> used for this, potentially).
>  - Implementing value semantics with runtime polymorphism.
> 

And, probably, in the future it will help to add other possibilities.
For example compile-time initialization of classes about which I here
spoke too (not in this thread)


> The only interesting thing there is value semantics with polymorphism.
> If you really care, you can implement polymorphism with structs.

Excellent templates, unit tests, closures, delegates, threads... And
after all it is offered to the programmer most implement OOP by hands?



More information about the Digitalmars-d mailing list