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: 103376,ae138939b724a2de X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Single element arrays as function parameters Date: Fri, 10 Jun 2011 22:54:47 +0200 Organization: A noiseless patient Spider Message-ID: References: <86ei31v43e.fsf@gareth.avalon.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 10 Jun 2011 20:54:43 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="zeAFTwWk1JWO9TY/bDbqcg"; logging-data="2086"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191GIt/HOCOYtifwNwprjr2" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: <86ei31v43e.fsf@gareth.avalon.lan> Cancel-Lock: sha1:6MQ9AiRpFL2bcSX3uNGn9ZTf+VY= Xref: g2news1.google.com comp.lang.ada:19737 Date: 2011-06-10T22:54:47+02:00 List-Id: Le 10/06/2011 22:11, Mart van de Wege a �crit : > M := Init.Creature( Name => "Dwarf", > Creature_Type => Humanoid, > Creature_Subtype => (Dwarf) ); > > The above call fails to compile: > > test_create.adb:13:45: positional aggregate cannot have one component This is the clue: it is interpreted as a parenthesized value, not as an aggregate. Just write: M := Init.Creature( Name => "Dwarf", Creature_Type => Humanoid, Creature_Subtype => (1 => Dwarf) ); -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00