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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-10 00:38:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!diablo.theplanet.net!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-nue1.dfn.de!uni-erlangen.de!lrz.de!not-for-mail From: Thomas Maier-Komor Newsgroups: comp.lang.ada Subject: class wide object in generic package Date: Mon, 10 Jun 2002 09:38:15 +0200 Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany) Message-ID: <3D045767.8020102@rcs.ei.tum.de> NNTP-Posting-Host: peejay.lpr.e-technik.tu-muenchen.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: wsc10.lrz-muenchen.de 1023694695 21512 129.187.151.167 (10 Jun 2002 07:38:15 GMT) X-Complaints-To: news@lrz-muenchen.de NNTP-Posting-Date: 10 Jun 2002 07:38:15 GMT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: de-de, en-us Xref: archiver1.google.com comp.lang.ada:25652 Date: 2002-06-10T07:38:15+00:00 List-Id: Hi everybody, I am getting this error message when compiling the code at the end of the message: generic_pac.adb:7:26: class-wide argument not allowed here generic_pac.adb:7:26: "eval" is not a primitive operation of "Object" my question is: first: is it possible to declare a procedure in the generic part so that it will be a primitive operation of Object? second: why isn't a class-wide argument not allowed in this place? Thanks, Tom generic_pac.ads: generic type Object is abstract tagged private; type Pointer is access all Object'class; with procedure eval(o : in out Object); package generic_pac is type gen is record p : Pointer; end record; procedure use_it(g : in out gen); end generic_pac; =========================================== generic_pac.adb: with Ada.Text_IO; use Ada.Text_IO; package body generic_pac is procedure use_it(g : in out gen) is begin Put_Line("generic_pac.use_it"); eval(g.p.all); end use_it; end generic_pac; -- ________________________________________________________________________ Dipl.-Ing. Thomas Maier-Komor http://www.rcs.ei.tum.de Institute for Real-Time Computer Systems (RCS) fon +49-89-289-23578 Technische Universitaet Muenchen, D-80290 Muenchen fax +49-89-289-23555