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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Operation can be dispatching in only one type Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <025105f2-5571-400e-a66f-ef1c3dc9ef32@g27g2000yqn.googlegroups.com> <691d6892-bc5e-4d81-8025-c36556bf2593@13g2000prl.googlegroups.com> <1h9hilcg5i6il.12edpgu4szw1h.dlg@40tude.net> <1wtsriaxu0s4s$.ikwnnz5teukp$.dlg@40tude.net> <1iipp3bn16fe2.yqa1gz1ru17a$.dlg@40tude.net> <18wh86jvjvoe0.cofxcc8udm6q$.dlg@40tude.net> <53a35ed9-88ac-43dc-b2a2-8d6880802328@j19g2000yqk.googlegroups.com> <4b091fb9$0$6567$9b4e6d93@newsspool4.arcor-online.net> <1w0q3zxzw79pt$.5z0juiky7kfd$.dlg@40tude.net> <0f177771-381e-493b-92bb-28419dfbe4e6@k19g2000yqc.googlegroups.com> <1nbcfi99y0fkg.1h5ox2lj73okx$.dlg@40tude.net> <59acf311-3a4a-4eda-95a3-22272842305e@m16g2000yqc.googlegroups.com> Date: Mon, 23 Nov 2009 09:52:52 +0100 Message-ID: <3pvk14f2iizi$.b3u242o1oqla.dlg@40tude.net> NNTP-Posting-Date: 23 Nov 2009 09:52:52 CET NNTP-Posting-Host: 5029733a.newsspool2.arcor-online.net X-Trace: DXC=44ac?9Tg5I5^8FBo0_81f>A9EHlD;3Yc24Fo<]lROoR18kF7enW;^6ZC`4IXm65S@:3>?8m5HYDNMgS< X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8208 Date: 2009-11-23T09:52:52+01:00 List-Id: On Sun, 22 Nov 2009 16:47:21 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> P.S. ":=" for initialization of limited objects might look misleading (and >> does look misleading to me), but that would be another discussion on Ada >> design, in which nobody would agree with me. So I prefer not to go into it. > > Well, I would agree. > > Ada uses the term "assignment" to refer to both "initial assignment / > initialization" and "assignment_statement / overwriting". > I'd prefer to use different symbols for the two. > We're not going to change Ada in that regard, for compatibility reasons, > but I'm thinking in my hobby language design to use the term "assignment" > for the initial one, and "reassignment" for the subsequent overwriting > one, and use different symbols for the two. > > So, for a limited type, "assignment" is legal, "reassignment" is not. > > What do you think? I would prefer conventional: allocation construction (initialization) assignment destruction (finalization) deallocation Semantically a limited object is never assigned. Its state comes into existence per construction and disappears per destruction. The word assignment for most people is associated with state change, assuming that there was some state before. So X : T := F (Y); looks equivalent to X : T; begin X := F (Y); But they are not. I would prefer proper constructors, e.g. X : T (Y); -- Y is a constraint of T, parameter of the constructor I don't like functions returning limited objects. But there also are two other forms of standard assignments. Depending on whether the left part is available: procedure ":=" (Left : in out T; Right : T); and function ":=" (Right : T) return T; Ada uses the second form, but obviously there are important cases where the first form is preferable (and conversely). And further, there are three variants per each concerning dispatch: procedure ":=" (Left : in out T; Right : T); -- Full MD procedure ":=" (Left : in out T; Right : T'Class); -- Target-controlled procedure ":=" (Left : in out T'Class; Right : T); -- Source-controlled It would be difficult to sort this out! (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de