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,bc3e3a6e4f85e03f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-12 18:59:21 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!howland.erols.net!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: class wide object in generic package Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Thu, 13 Jun 2002 01:58:30 GMT References: <3D045767.8020102@rcs.ei.tum.de> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:25842 Date: 2002-06-13T01:58:30+00:00 List-Id: Stephen Leake writes: > "Ehud Lamm" writes: > > > It seems to me you want as a generic paramter any type that has the Eval > > operation. > > So you can define a parent type having this operation (say an abstract type > > called Evalable). > > Now you can define the generic > > > > with Evalable_Pak; > > generic > > type My_Evalable is new Evalable_Pak.Evalable with private; > > .... > > > > My_Evalable will have a primitive Eval operation. > > Yes, it will have an Eval operation, but that operation will _not_ be > visible in the generic body. That's not correct. My_Evaluable inherits a primitive Eval from Evalable_Pak.Evalable, and this may be called in the generic body. In the instance, it will call the Eval for the actual type. >... The generic body does _not_ "read" the > package spec for Evalable_Pak. It does. > That's why you need the generic formal package parameter; then the > generic body _does_ see everything in the generic formal package spec. That's another way of doing things. - Bob