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,FREEMAIL_FROM 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 11:50:23 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!sccrnsc02.POSTED!not-for-mail From: Caffeine Junky Subject: Re: A little help on Generics. Newsgroups: comp.lang.ada References: User-Agent: Pan/0.11.3 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Jeffrey Creem" Message-ID: NNTP-Posting-Host: 12.245.48.122 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc02 1024944622 12.245.48.122 (Mon, 24 Jun 2002 18:50:22 GMT) NNTP-Posting-Date: Mon, 24 Jun 2002 18:50:22 GMT Organization: AT&T Broadband Date: Mon, 24 Jun 2002 18:50:22 GMT Xref: archiver1.google.com comp.lang.ada:26664 Date: 2002-06-24T18:50:22+00:00 List-Id: On Mon, 24 Jun 2002 06:49:07 -0400, Jeffrey > 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. I dont seem to be having any problems with the body of the package, it was just with the declaration of the package. The only errors the compiler gave me told me that procedure Push was not visible, Pop was not visible, etc... However when running the compiler over just the package, it produces a nice object file. Which leads me to beleive that my problem is in calling the package from my test program rather than in the package itself. However, just to be sure, here is a copy of the body of the package... package body genstack is procedure Push(X : in Item; S : in out Stack) is begin S := new Cell'(X, S); end Push; function Pop(S : in Stack) return Item is G : Item; begin G := S.Value; S := S.Next; return G; end Pop; function Is_Empty(S : in Stack) return Boolean is begin if S.Next = null then return True; else return False; end if; end Is_Empty; end genstack; Any pointers would be appreciated, as usual. St4pL3