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-Thread: a07f3367d7,15480fcd593513b9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!aioe.org!nospam From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: Table of pointers question Date: Sat, 26 Sep 2009 10:51:04 -0400 Organization: The Wasteland Message-ID: References: <3cadnZif2YjGbyfXnZ2dnUVZ_tmdnZ2d@earthlink.com> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.0 Cancel-Lock: sha1:8oY1LEoX341uSutbkv7bcdNAetI= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: g2news2.google.com comp.lang.ada:8485 Date: 2009-09-26T10:51:04-04:00 List-Id: In article , Rob Solomon wrote: [...] > The syntax of the statement is also confusing to me. > > EntryPointerList(NumberOfEntries) := > new DirectoryEntryType'(NewEntry); > > It would help me to break this statement down more. Why is the last > part written the way it is? It uses a single quote and parens. I > don't understand this syntax. How does this store data on the heap > and then return a pointer to assign to the pointer list? In this context, the allocator [1] includes a qualified expression [2]. When the expression is evaluated, "An object of the designated type is created and the value of the qualified_expression is converted to the designated subtype and assigned to the object." The resulting access value, which points to the newly created object, is stored in the EntryPointerList array at index NumberOfEntries. Ada also uses "'" to indicate attributes [3]. [1] [2] [3] -- John B. Matthews trashgod at gmail dot com