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,LOTS_OF_MONEY 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-24 06:19:04 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: what means the " ' " in use with a record type? Date: 24 Aug 2002 06:19:04 -0700 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0208240519.9e2a872@posting.google.com> References: NNTP-Posting-Host: 205.232.38.49 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1030195144 32453 127.0.0.1 (24 Aug 2002 13:19:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 24 Aug 2002 13:19:04 GMT Xref: archiver1.google.com comp.lang.ada:28368 Date: 2002-08-24T13:19:04+00:00 List-Id: tmoran@acm.org wrote in message news:... > > return new node'(value => x, to => l); > > what means the apostrophe between node and (value => ......? > It means you want to allocate a new object of type "node" and > give it an initial value of (x,l). This is highly misleading, The questioner asked about the apostrophe, and Tom is answering about the whole construct. The quote has nothing whatever to do with allocation. The expression node'(....) is called a qualified expression. In some contexts you can simply write the aggregate (in this case (value => x, to => 1)) and it is obvious what you are talking about. For example N : node := (value => x, to => 1); is just fine because we obviously expect a node here. But if I just write 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 a'b in general says, I have something of type a with the value computed by the expression b. So to fix the allocator we need x := new node'(value => x, to => 1); and now the allocator knows what type of thing you are trying to allocate.