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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ab70d73db4e3823 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Generic primitives Date: 1999/08/04 Message-ID: <37a7bac3@news1.us.ibm.net>#1/1 X-Deja-AN: 508635265 Content-transfer-encoding: 7bit References: X-Trace: 4 Aug 1999 04:00:03 GMT, 129.37.213.168 Organization: Global Network Services - Remote Access Mail & News Services X-Notice: should be reported to postmaster@ibm.net Content-Type: text/plain; charset="US-ASCII" Mime-version: 1.0 Newsgroups: comp.lang.ada X-Complaints-To: postmaster@ibm.net Date: 1999-08-04T00:00:00+00:00 List-Id: In article , aidan@skinner.demon.co.uk (Aidan Skinner) wrote: >Right, I'm wondering if it's possible to make a generic program a >primitive operation of a class. I've been away from CLA for awhile, and so I'm not sure if anyone answered your question. The answer is, No, generic operations aren't primitive for the type. Mats Weber discussed this feature (flaw?) in his PhD thesis. I don't have the URL handy. Can you make the operation class-wide? What about making a (non-generic) primitive operation that takes Bar as an argument (pointer to subprogram)? > declare > type Foo is abstract tagged private; > > generic > with procedure Bar (Flibble : in Foo); > > procedure Tribble (Flibble : in Foo) is abstract; > > type Fubar is new Foo with null record; > > procedure Tribble (Flibble : in Fubar) is > > begin > Bar (Flibble); > end Tribble; > > type Wibble is new Fubar; > > Wibble1 : Wibble; > > Tribble (Wibble1); > > end;