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,7b6305d0d57a9f34 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.146.17 with SMTP id f17mr1007490bkv.5.1319922911048; Sat, 29 Oct 2011 14:15:11 -0700 (PDT) Path: l23ni18387bkv.0!nntp.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feedme.ziplink.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Normalizing array indices Date: Sat, 29 Oct 2011 22:15:09 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="4170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HBap7kxk1khQ1GAdTlyXlpSQTJeqW4GQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:LmZd7xfEdf9FAhP+JM2Zl2IXv90= sha1:eDAdqayywRFYYrJug41HOi54ATc= Xref: news2.google.com comp.lang.ada:14243 Content-Type: text/plain; charset=us-ascii Date: 2011-10-29T22:15:09+01:00 List-Id: tmoran@acm.org writes: >> > generic >> > type Element_Type is private; >> > type Sort_Array_Type is array (Positive range<>) of Element_Type; >> > with function "<" (Left, Right: Element_Type) return Boolean is<>; >> > procedure Sort(A: in out Sort_Array_Type) > > How about > with function Earlier (Left, Right: Element_Type) return Boolean is<>; That would be Before in the spirit of 2012 (A.18.26 9.1/3 ff). Though in that case the reasoning is probably that the parameters of Before are indices; so the semantics are something like Indexed_Element_Is_Before. > Otherwise one gets oddities like > procedure Sort_Decreasing is new Sort(..., "<" => ">"); Odd but understandable after you've seen it once or twice.