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,2ac407a2a34565a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.129.169 with SMTP id nx9mr3684534pbb.2.1330558050305; Wed, 29 Feb 2012 15:27:30 -0800 (PST) Path: h9ni24593pbe.0!nntp.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-out.readnews.com!transit3.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Array Help? Date: Wed, 29 Feb 2012 18:27:29 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <10615783-d4a9-4cbd-8971-53ba1100d6a0@b18g2000vbz.googlegroups.com> <17412419.40.1330534213855.JavaMail.geo-discussion-forums@vbva11> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1330558049 31571 192.74.137.71 (29 Feb 2012 23:27:29 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 29 Feb 2012 23:27:29 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:/q+QrM4mI27ckx/5C+UvbBnIKoI= Content-Type: text/plain; charset=us-ascii Date: 2012-02-29T18:27:29-05:00 List-Id: Robert A Duff writes: > % ./array_test > > raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : predicate failed at array_test.adb:14 Actually, I just realized there's a workaround for the slice problem. The following does not raise any exception. procedure Array_Test is type Integer_Array is array (Positive range <>) of Integer with Dynamic_Predicate => Integer_Array'First = 1; procedure Foo (Param : in out Integer_Array) is begin null; end Foo; A : Integer_Array (1 .. 10) := (others => 0); subtype Slide is Integer_Array(1..6); begin Foo (Slide(A (3 .. 8))); end Array_Test; But that's kind of tricky; I wouldn't do that without copious comments. And some constants or something to avoid violating the DRY principle. - Bob