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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2f63c66b1f04412d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-18 01:06:04 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!skynet.be!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Marius Amado Alves Newsgroups: comp.lang.ada Subject: Re: How to define an array of a variant record type? Date: Tue, 18 Nov 2003 09:04:42 +0000 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1069146287 65736 80.67.180.195 (18 Nov 2003 09:04:47 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 18 Nov 2003 09:04:47 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: X-Mailer: Ximian Evolution 1.4.5 X-OriginalArrivalTime: 18 Nov 2003 09:04:28.0466 (UTC) FILETIME=[F8B15120:01C3ADB2] X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:2616 Date: 2003-11-18T09:04:42+00:00 On Tue, 2003-11-18 at 02:48, Steve wrote: > "Marius Amado Alves" wrote: > > To simulate arrays of indefinite or unconstrained elements in Ada you > > must use pointers... > Dynamic allocation is inherently more risky (having potential for memory > leaks) than simply using a discriminated record with a default discriminant. You're right. Default discriminants is a better way for arrays of variant records. I had forgotten such types are definite (and can therefore be array components).