comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: Controlled types and exception safety
Date: Fri, 09 Dec 2005 06:33:38 GMT
Date: 2005-12-09T06:33:38+00:00	[thread overview]
Message-ID: <6z9mf.1704$Tg2.1265@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <dvidnUm4m8crcQXeRVn-gw@megapath.net>

Randy Brukardt wrote:
> 
> You're expecting a bitwise copy to work for that? That seems wrong; since
> the advantage to your scheme is that you can do operations on the old
> left-hand side before the assignment. But if that "old" object is a
> temporary, you have no access to it, and you have degraded to the current
> scheme. Except that it is worse, because you can't have position-dependent
> items.

I'm not being very clear or precise, am I? We're talking about default 
assignment for a type with a component with user-defined assignment, but the 
component doesn't exist in the LHS. If that's the only component with 
user-defined assignment, then you can't use the LHS during assignment anyway, so 
you can assign to an intermediate for the whole value without losing anything.

If you have components with user-defined assignment in the LHS, and they 
continue to exist after the discriminants change, then you would use the 
components themselves. If you have a mix, then you can use intermediates only 
for the objects that don't already exist in the LHS.

We've probably beaten this dead horse too much already.

> That seems odd to me; what's the value of preventing aggregates of types
> containing components of the limited type? (Preventing aggregates of limited
> private types is a feature of private types, not limited types.)
> 
> Not in Ada 95; you can't write a useful function without standing on your
> head. Such a function can only return a global variable, which is ugly at
> best and impossible for anything but literal constants.

I think we're talking at cross purposes. I'm talking about changes that I 
thought Ada 83 needed. You're talking about how things work in Ada 95. In Ada 
83, the only limited types were tasks and private types (and types with limited 
components), and for the most part I'm thinking of limited private types that 
are not limited in the full view.

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers
49



  reply	other threads:[~2005-12-09  6:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30 13:57 Controlled types and exception safety Maciej Sobczak
2005-11-30 15:06 ` Dmitry A. Kazakov
2005-11-30 16:19   ` Maciej Sobczak
2005-12-01  0:05     ` Stephen Leake
2005-12-01  9:21     ` Dmitry A. Kazakov
2005-12-01 10:46       ` Maciej Sobczak
2005-12-01 15:08         ` Dmitry A. Kazakov
2005-12-02  4:17           ` Randy Brukardt
2005-12-02  9:29             ` Maciej Sobczak
2005-12-02 18:12               ` tmoran
2005-12-02 19:15                 ` Robert A Duff
2005-12-02 21:42                   ` tmoran
2005-12-06  9:00                     ` Maciej Sobczak
2005-12-06  9:50                       ` Dmitry A. Kazakov
2005-12-06 18:34                         ` Jeffrey R. Carter
2005-12-06 19:34                           ` Randy Brukardt
2005-12-06 21:20                             ` Dmitry A. Kazakov
2005-12-07  1:57                             ` Jeffrey R. Carter
2005-12-08  0:50                               ` Randy Brukardt
2005-12-08 19:37                                 ` Jeffrey R. Carter
2005-12-09  2:36                                   ` Randy Brukardt
2005-12-09  6:33                                     ` Jeffrey R. Carter [this message]
2005-12-09 20:35                                       ` Randy Brukardt
2005-12-10  7:53                                         ` Jeffrey R. Carter
2005-12-06 20:43                           ` Dmitry A. Kazakov
2005-12-07  2:00                             ` Jeffrey R. Carter
2005-12-07 10:01                               ` Dmitry A. Kazakov
2005-12-02 23:21             ` Robert A Duff
2005-11-30 17:46 ` Jean-Pierre Rosen
2005-11-30 21:02 ` Jeffrey R. Carter
2005-11-30 22:06   ` Björn Persson
2005-11-30 23:52     ` Randy Brukardt
2005-12-01  5:26     ` Jeffrey R. Carter
2005-12-02 23:51       ` Robert A Duff
2005-12-06 11:41   ` Peter C. Chapin
2005-12-06 12:50     ` Jean-Pierre Rosen
2005-12-06 13:06     ` Dmitry A. Kazakov
replies disabled

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