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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b52a18baa90247c4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-04 08:40:18 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!news.umbc.edu!eff!blanket.mitre.org!linus.mitre.org!linus!mbunix!eachus From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: Newbie Generic Reg Exp Pattern Matching Question Date: 4 Oct 94 11:29:39 Organization: The Mitre Corp., Bedford, MA. Message-ID: References: <36p5vsINNcjt@edna.cc.swin.edu.au> NNTP-Posting-Host: spectre.mitre.org In-reply-to: 944166@edna.swin.edu.au's message of 3 Oct 1994 14:54:52 GMT Date: 1994-10-04T11:29:39+00:00 List-Id: In article <36p5vsINNcjt@edna.cc.swin.edu.au> 944166@edna.swin.edu.au (Jimmy Fang) writes: 33 with function "=" ( Left : in ITEM; 34 Right : in ITEM) return Boolean; ** *****E equality parameters must be same limited type [LRM 6.7/4] ** 35 This certainly looks like a compiler bug. It is illegal to explicitly declare an equality function for a private type, (except by using the "Goodenough" workaround), but as a generic subprogram parameter it is legitimate. First report the bug to your compiler vendor, then try one (or more) of the following workarounds: 1) It may be the case that if you provide a default the compiler will let this through. Try: with function "=" ( Left : in ITEM; Right : in ITEM) return Boolean is <>; Can't hurt to try, and it really should be written this way anyway. 2) Change the name of the equality subprogram in your generic formal parameter list, and modify the body of the package to use the renamed operation. (Ugh! Not very maintianable.) 3) Declare a generic as follows: generic type LP is limited private; with function Equal(L,R: LP) return Boolean; function "="(L,R: LP) return Boolean; function "="(L,R: LP) return Boolean is begin return Equal(L,R); end "=" Now modify your code to pass an equality function in under some other name, then instantiate this function in the package specification. This is the Goodenough "trick." 4) As in one above but hide the instantiation in the body of your generic. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...