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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b5ab7c96b188b59e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-15 19:11:20 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn13feed!worldnet.att.net!attbi_feed3!attbi.com!attbi_s54.POSTED!not-for-mail From: "Mark A. Biggar" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: The "()" operator revisited. References: <4003EEEC.40106@noplace.com> <%1WMb.25$3f4.77748@news20.bellglobal.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.6.216.235 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s54 1074222680 24.6.216.235 (Fri, 16 Jan 2004 03:11:20 GMT) NNTP-Posting-Date: Fri, 16 Jan 2004 03:11:20 GMT Organization: Comcast Online Date: Fri, 16 Jan 2004 03:11:20 GMT Xref: archiver1.google.com comp.lang.ada:4450 Date: 2004-01-16T03:11:20+00:00 List-Id: Robert A Duff wrote: > "Warren W. Gay VE3WWG" writes: > > >>Robert A Duff wrote: >> >>>"Warren W. Gay VE3WWG" writes: >>> >>>>Was operator assignment ever considered for Ada? If it was, and shot >>>>down, what were the primary reasons against it? >>> >>>See AARM-7.6(17.a). >>>- Bob >> >>I looked at this, but this doesn't really address the question. >>This info talks about controlled types, adjust etc. and what >>it should or shouldn't do, implementation details etc. >> >>Perhaps I need to rephrase the question: If C++ proponents >>thought it necessary (or useful) to include an assignment >>operator, why was it that the Ada language (Ada83) was >>developed without one? Can anyone answer this or point back >>to early Ada discussions about this? > > > Sorry, I didn't realize you were talking about Ada 83. Why can't the > user redefine ":=" in Ada 83? I don't know, but I guess the designers > didn't like users redefining stuff like that. Same reason the user > can't redefine "in" or aggregate notation or literal notation or array > indexing notation, I guess. It seems inconsistent with the fact that > you *can* redefine "=" and "+" and so forth. > > In Ada 9X, we decided the user *should* be able to redefine the behavior > of ":=". AARM-7.6(17.a) explains why we didn't do that in the "obvious" > way -- some sort of syntax like: > > procedure ":="(...); > > which would correspond directly to the way C++ does it. > It has to do with mutable record types (defaulted discrims). > That's unfortunate; if you want to redefine ":=" for a non-mutable > type, it's pretty annoying to be told you can't do that because > mutable types exist in the language. > > The C++ way has some advantages over the Ada way (where the user's > control is split between Finalize and Adjust) because it's sometimes > convenient to get your hands on both sides of the assignment at the same > time. There are other issues as well. Ada has several things that look like assigmment but are subtly different: Variable initialization, function return, by-value parameter binding, etc. It was decided that allowing a user to redefine assignment piecewise (initialize, adjust, finalize) would allow the compiler to compose the various assignment like operations out of those pieces and other things like bit-wise memory copy without requiring the user to define all those different variants. -- mark@biggar.org mark.a.biggar@comcast.net