From: "Mark A. Biggar" <mark@biggar.org>
Subject: Re: The "()" operator revisited.
Date: Fri, 16 Jan 2004 03:11:20 GMT
Date: 2004-01-16T03:11:20+00:00 [thread overview]
Message-ID: <sDINb.62419$Rc4.222955@attbi_s54> (raw)
In-Reply-To: <wcczncpgjzv.fsf@shell01.TheWorld.com>
Robert A Duff wrote:
> "Warren W. Gay VE3WWG" <warren@ve3wwg.tk> writes:
>
>
>>Robert A Duff wrote:
>>
>>>"Warren W. Gay VE3WWG" <warren@ve3wwg.tk> 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
next prev parent reply other threads:[~2004-01-16 3:11 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-12 17:53 The "()" operator revisited Frank J. Lhota
2004-01-12 18:38 ` Frank J. Lhota
2004-01-12 22:26 ` Robert A Duff
2004-01-13 16:29 ` Frank J. Lhota
2004-01-13 9:24 ` Dmitry A. Kazakov
2004-01-13 16:44 ` Frank J. Lhota
2004-01-13 17:13 ` Hyman Rosen
2004-01-13 22:27 ` Randy Brukardt
2004-01-14 2:30 ` Stephen Leake
2004-01-14 9:04 ` Dmitry A. Kazakov
2004-01-17 0:15 ` Kenneth Almquist
2004-01-17 21:15 ` Robert A Duff
2004-01-19 10:25 ` Dmitry A. Kazakov
2004-01-13 13:13 ` Marin David Condic
2004-01-13 17:38 ` Warren W. Gay VE3WWG
2004-01-13 19:09 ` Robert A Duff
2004-01-15 17:30 ` Warren W. Gay VE3WWG
2004-01-15 18:11 ` Robert A Duff
2004-01-15 19:36 ` tmoran
2004-01-15 20:35 ` Robert A Duff
2004-01-17 5:48 ` Robert I. Eachus
2004-01-16 1:52 ` Redefining := (was: The "()" operator revisited.) Jeffrey Carter
2004-01-16 21:37 ` Randy Brukardt
2004-01-19 11:33 ` Dmitry A. Kazakov
2004-01-16 3:11 ` Mark A. Biggar [this message]
2004-01-16 13:28 ` The "()" operator revisited Hyman Rosen
2004-01-16 16:19 ` Robert A Duff
2004-01-16 18:09 ` Warren W. Gay VE3WWG
2004-01-16 13:56 ` Frank J. Lhota
2004-01-16 16:14 ` Robert A Duff
2004-01-16 21:29 ` Frank J. Lhota
-- strict thread matches above, loose matches on Subject: below --
2004-01-13 17:46 amado.alves
2004-01-13 22:21 ` Randy Brukardt
2004-01-13 17:53 amado.alves
2004-01-14 9:09 ` Dmitry A. Kazakov
2004-01-14 12:55 ` Georg Bauhaus
2004-01-14 15:05 ` Dmitry A. Kazakov
2004-01-15 1:21 ` Georg Bauhaus
2004-01-15 8:50 ` Dmitry A. Kazakov
2004-01-15 11:09 ` Georg Bauhaus
2004-01-15 13:23 ` Dmitry A. Kazakov
2004-01-17 6:26 ` Robert I. Eachus
2004-01-14 13:04 ` Hyman Rosen
2004-01-14 15:22 amado.alves
2004-01-14 16:16 ` 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