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,59e1f81123faf689 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-25 08:48:52 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uunet!sea.uu.net!ash.uu.net!world!news From: "Ben Brosgol" Subject: Re: what means the " ' " in use with a record type? X-Mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: X-Priority: 3 Date: Sun, 25 Aug 2002 15:42:17 GMT X-Msmail-Priority: Normal References: <5ee5b646.0208240519.9e2a872@posting.google.com> NNTP-Posting-Host: ppp0c069.std.com Organization: The World @ Software Tool & Die X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:28391 Date: 2002-08-25T15:42:17+00:00 List-Id: Tom Moran wrote: > I suspect that qualified expressions are fairly rare in practice > except for an allocation with an initial value. > > > x := new (value => x, to => 1); > > > > then the allocator has no idea what you are talking about, since there is > > nothing to say that this is a node. The qualified expression fixes this > If x is an access to type node, why is the qualified expression needed, > while it's not needed in: > type fruits is (apple, orange, banana); > type colors is (red, orange, yellow); > color : colors; > fruit : fruits; > begin > color := orange; > fruit := orange; As I recall, the original reason for the apostrophe is because, in the absence of this feature, the general construct new T(expr) could be ambiguous (or at least confusing to the human reader) in some contexts -- i.e., is expr the value of a discriminant, or is it an initialization for the allocated object? The apostrophe clearly indicates the intent, and can also serve the purpose of a type qualification as Robert observed. Ben Brosgol Ada Core Technologies