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,e12ee9b0877029b2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-11 00:23:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.kjsl.com!HSNX.atgi.net!newsfeed.media.kyoto-u.ac.jp!np0.iij.ad.jp!news.iij.ad.jp!news01.iij4u.or.jp!not-for-mail From: Andrew Hoddinott Newsgroups: comp.lang.ada Subject: Re: Disagreement between GNAT and Cohen? Date: Tue, 11 Jun 2002 16:23:05 +0900 Organization: Internet Initiative Japan Inc., Tokyo, JAPAN Message-ID: <3D05A559.9020502@golter.demon.co.uk> References: <3D05456D.7050001@golter.demon.co.uk> NNTP-Posting-Host: h032.p997.iij4u.or.jp Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: news01.iij4u.or.jp 1023780187 13493 210.138.229.32 (11 Jun 2002 07:23:07 GMT) X-Complaints-To: news@iij.ad.jp NNTP-Posting-Date: 11 Jun 2002 07:23:07 GMT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ja-JP; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: ja Xref: archiver1.google.com comp.lang.ada:25730 Date: 2002-06-11T07:23:07+00:00 List-Id: Robert A Duff wrote: > See 8.5.4(5/1). > > The AARM explains the reason for the rule: basically to make (efficient) > implementation easier. Thanks for that. I had somehow managed to read straight through that paragraph without spotting the word Intrinsic :-S I'm still puzzled though. Cohen's actual example (p. 696-7) is: generic type Element_Type is (<>); package Generic_Discrete_Sets is type Set_Type is private; function Union (Set_1, Set_2 : Set_Type ) return Set_Type; -- ... more functions and types private type Set_Type is array (Element_Type) of Boolean; end Generic_Discrete_Sets; package body Generic_Discrete_Sets is function Union (Set_1, Set_2 : Set_Type) return Set_Type renames "or"; -- ... more function bodies end Generic_Discrete_Sets; generating the errors: generic_discrete_sets.adb:2:04: not subtype conformant with declaration in package Standard generic_discrete_sets.adb:2:04: return type does not match He specifically draws attention to the package body using "the versions of the logical operators 'and', 'or', and 'not' that apply component by component to one-dimensional arrays of Boolean values", and bases an exercise (15.3) around the example too. Is he just making this up? Or is there some way that the frozen-ness of the intrinsic logical operators can vary between compilers so that this example sometimes works? And the intrinsic not getting an explicit mention in the error message in this slightly more complex case is because ... ? Sorry. Since I know how to work around the problem, I should probably just shut up and go on to the next exercise, but ... ;-)