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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: syntaxic exploration Date: Thu, 21 Dec 2017 01:21:51 -0600 Organization: JSA Research & Innovation Message-ID: References: <0d33e631-e63d-4346-ac95-5eec72127f4f@googlegroups.com> <0fa75dd5-599b-4a38-a5d4-3151bbe5172f@googlegroups.com> Injection-Date: Thu, 21 Dec 2017 07:21:53 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="19428"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:49566 Date: 2017-12-21T01:21:51-06:00 List-Id: "Mehdi Saada" <00120260a@gmail.com> wrote in message news:0fa75dd5-599b-4a38-a5d4-3151bbe5172f@googlegroups.com... > Hum, how do I write a array component with one element ? Something like > (_discriminant_, (0)) (array starting from 0) doesn't work. It shows: > p_poly_v1_g.adb:40:63: positional aggregate cannot have one component > p_poly_v1_g.adb:40:63: write instead "T_Vect_Coef'First => ..." > > But Array_type'First..Array_type'Last doesn't seem fine when there's just > one element... > Or better, none. How do I write that for an empty array ?? Ada has no good way to write an empty array. I usually use (1 .. 0 => <>) for that, but nothing is really satisfying. For a single element, write a single choice (a choice doesn't have to be a range!) The compiler error message gives a suggestion. Randy.