comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <no.spam@no.spam.com>
Subject: Re: Limited_Controlled and constructor functions
Date: Mon, 22 Jan 2007 09:59:16 +0100
Date: 2007-01-22T09:59:16+01:00	[thread overview]
Message-ID: <ep1ud4$n91$1@cernne03.cern.ch> (raw)
In-Reply-To: <1qu3xfyfc024$.phvronbnfx6j.dlg@40tude.net>

Dmitry A. Kazakov wrote:

>> In C++ it's two lines of code or even half:
>>
>> class MyClass : boost::noncopyable
>> ...
> 
> Huh, C++ has even weaker means to describe formal types contracts. It has
> dire <class T>. In Ada there is limited, tagged, range <> etc. Far too
> weak, IMO, but still better than C++.

Yes, except that I'm not suprised by what C++ offers with regard to 
class definitions. I was very surprised by the semantics of Controlled 
and Limited_Controlled and their funny effects on other parts of my program.

>>  > send them over IP...
>>
>> Then we're talking about serialization.
> 
> Egh, no, serialization is ordering in time.

You are right. Me too:

http://en.wikipedia.org/wiki/Serialization

> To be able to copy is about
> lack of identity and memory-isotropy.

Not really. Memory isotropy (cool technical buzz, btw ;-) ) is about 
memcpy and memmove. Copy semantics is about what happens when you use 
relevant language constructs. If memory isotropy is a property of any 
given type, then copy semantics can be automatically derived. Otherwise 
it has to be explicitly defined.

>> Limited types don't forbid it.
> 
> Limited types is a kludge.

A particularly nasty one.

> There should be a simpler and clearer way to say
> that the thingy has no visible compiler-generated copy constructor, no
> equality, no aggregates, no assignment

Amen.


-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/



  reply	other threads:[~2007-01-22  8:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18  9:51 Limited_Controlled and constructor functions Maciej Sobczak
2007-01-18 12:13 ` AW: " Grein, Christoph (Fa. ESG)
2007-01-18 16:41 ` Robert A Duff
2007-01-19  7:58   ` Maciej Sobczak
2007-01-19  9:41     ` Dmitry A. Kazakov
2007-01-19 13:45       ` Maciej Sobczak
2007-01-19 14:33         ` Dmitry A. Kazakov
2007-01-22  8:59           ` Maciej Sobczak [this message]
2007-01-20 17:09     ` Gautier
2007-01-20 19:39       ` Gautier
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox