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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,407c890f49bff7e2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-24 03:49:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi_feed3!attbi.com!sccrnsc03.POSTED!not-for-mail From: "Jeffrey Creem" Newsgroups: comp.lang.ada References: Subject: Re: A little help on Generics. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: NNTP-Posting-Host: 66.31.5.146 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1024915747 66.31.5.146 (Mon, 24 Jun 2002 10:49:07 GMT) NNTP-Posting-Date: Mon, 24 Jun 2002 10:49:07 GMT Organization: AT&T Broadband Date: Mon, 24 Jun 2002 10:49:07 GMT Xref: archiver1.google.com comp.lang.ada:26643 Date: 2002-06-24T10:49:07+00:00 List-Id: "Caffeine Junky" wrote in message news:iOyR8.304072$cQ3.16530@sccrnsc01... > So far I've got Accesses and arrays and stuff figured out. I've kinda got > the package system figured out. But I'm having trouble figuring out how > to use Generics. More specifically, I know how to create a generic > package(at least the compiler doesnt give me any errors when making an > object file). > I just dont know the proper way to instantiate it. > > Heres a package spec and a test file that you guys can peak at and > hopefully give me some hints as to what I'm doing wrong. > > (Please be kind, I'm still a newbie. Heh.) > > declare > > type Int_Stack is new genstack(Max => 500, Item => Integer); > > Since you did not post the body you may have other problems here but the first I see is the syntax here. Try something like package Int_Stack is new genstack(Max => 500, Item => Integer); Also, try to avoid the 'img attribute even in your test code..It is a handy feature but is not portable..It is a nice trick to have up your sleeve but it is only a few more kestrokes to type integer'image(ints(J)). I there are a few more problems lurking in that test driver as well but I am sure you will find these soon enough.