From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1888e8caa20a2f2d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 06 Dec 2005 13:30:09 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <8sKdnXNeIZMxIg3eRVn-ig@comcast.com> <3trncoj4t0va.19bs46zhm4xbe.dlg@40tude.net> <2Rklf.171$n1.114@newsread2.news.pas.earthlink.net> Subject: Re: Controlled types and exception safety Date: Tue, 6 Dec 2005 13:34:29 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-ZQQJ39Wpg2/bBrdOep6qi0AifBjxD9LgSKaIxWtlnj2uX69jSA7V1260LSWSXhe4lQD2H0OU7DIZl/c!o5nt7WPtGHlKIThZeXubYMJmCcOEcFa1iSf6rissoBQUjZIn1J4NcsGquVLKWGPmouTLbmRJvOBM X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:6754 Date: 2005-12-06T13:34:29-06:00 List-Id: "Jeffrey R. Carter" wrote in message news:2Rklf.171$n1.114@newsread2.news.pas.earthlink.net... > Personally, I would have preferred > > procedure R'Assign (To : in out R; From : in R); > > for any record type R. This can be redefined by the user: > > for R'Assign use My_Assignment_Procedure; > > I have seen objections to this approach, but none that aren't handled by one of > the following rules: This was the original idea for Ada 95, but it doesn't work. That's because the object on the left-hand side may come into existence because of the outer assignment, or disappear because of the assignment. The beauty (and curse) of Adjust is that it can be called by itself when needed, or with an appropriate Finalize. You can't, in general, read the object that you're assigning into. That means that user-defined assignment in Ada can never be as powerful as that in other languages (unless you somehow prevent the types from being used in discriminant-dependent components - which would probably be a generic contract problem). For an another explanation of this, see ARM 7.6(17.a-17.h). http://www.adaic.com/standards/95aarm/html/AA-A-5-3.html The other issues are solveable, but this one is not. Randy Brukardt