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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,77f1de37204ed8a6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-03 08:50:31 PST From: "Nacho Robledo" Newsgroups: comp.lang.ada References: Subject: Re: Operator visibility question Date: Sun, 3 Jun 2001 17:47:46 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 212.163.228.11 Message-ID: <3b1a5cb5_4@news.arrakis.es> X-Trace: 3 Jun 2001 17:50:13 +0100, 212.163.228.11 Organization: Arrakis Servicios y Comunicaciones SLU Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!nntp1.aeq.teleglobe.net!teleglobe.net!newsfeed.mad.ttd.net!caladan.arrakis.es Xref: archiver1.google.com comp.lang.ada:8038 Date: 2001-06-03T17:47:46+02:00 List-Id: I am not a good ada programmer but try this piece of code: C: constant Boolean := MT."<"(A+2,B); I am not sure if this will run well but i think is the most common thing you can do.... Good luck!!!!! -- -- Ignacio Robledo Rosell mailto:rrilpm@arrakis.es http://zipi.fi.upm.es/~g990406 **************************************** "When code matters more than comercials" **************************************** "Rod Chapman" escribi� en el mensaje news:ba18d5cb.0106030548.62aa45e2@posting.google.com... > Can anyone please tell me if the following code is legal? > > package MT > is > type T is range 0 .. 4; > end MT; > > with MT; > --# inherit MT; > package VT > is > function "+" (Left, Right : in MT.T) return MT.T renames MT."+"; > A : constant := 2; > B : constant MT.T := 3; > > C : constant Boolean := (A + 2) < B; -- Is "<" visible here? > end VT; > > The SPARK Examiner rejects the declaration of C with the message: > > 9 C : constant Boolean := (A + 2) < B; -- Is "<" visible here? > ^ > *** Semantic Error :309: Operator not visible for these types. > > On the other hand, GNAT 3.13 accepts the code with no errors. Can anyone > explain which is right, and (more importantly) why? > Cheers, > Rod Chapman > SPARK Team > Praxis Critical Systems