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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae9506fd4dcf7090 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-23 02:34:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Concatenation and Characters Date: Wed, 23 Oct 2002 11:34:35 +0200 Message-ID: References: <44hp9.807$_u6.205@nwrddc01.gnilink.net> <3DA5AE5F.3030902@attbi.com> <3DB03EF1.EE771923@mmm.com> <3DB43EB0.AAF4B38C@mmm.com> <3DB44B9C.80007@worldnet.att.net> <3DB466CB.7CE0BC59@mmm.com> <3DB4C9C4.1070003@worldnet.att.net> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1035365676 28528481 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:30065 Date: 2002-10-23T11:34:35+02:00 List-Id: On Wed, 23 Oct 2002 09:08:24 +0000 (UTC), Lutz Donnerhacke wrote: >* Dmitry A Kazakov wrote: >>>However, you can write this: >>> >>> return (1..0 => 123); >>> >>>if the component type is Integer, say. This is annoying, because you >>>have to invent a completely junk value -- 123 is never used. >> >> BTW, do you know a solution of this problem for generics? Let the >> array element is a generic parameter and there is no Null_Element >> parameter, where to get a junk value? > >There are several other cases where a default value can't be specified (task). >Then I use > declare > empty : Array_Type (Offset_Type'Last .. > Offset_Type'Pred(Offset_Type'Last)); > begin > return empty; > end; There is a pathological case when this does not work: type Index is new Integer range Integer'First..Integer'First; type Array_Type is array (Index range <>) of Integer; Empty : Array_Type (Index'Last..Index'Pred (Index'Last)); -- Constraint_Error ------------------------------- Could we inroduce an attribute, say S'Empty, which for an array type would give an empty array and for a discrete type an empty range? --- Regards, Dmitry Kazakov www.dmitry-kazakov.de