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 13:21:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!wn3feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc01.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: sccrnsc01 1024950098 66.31.5.146 (Mon, 24 Jun 2002 20:21:38 GMT) NNTP-Posting-Date: Mon, 24 Jun 2002 20:21:38 GMT Organization: AT&T Broadband Date: Mon, 24 Jun 2002 20:21:38 GMT Xref: archiver1.google.com comp.lang.ada:26671 Date: 2002-06-24T20:21:38+00:00 List-Id: Ok..In any case your first real problem is with the instantiation which should look like the one i gave you v.s. the one you used. There are several things wrong with the body (not using Max, not actually filling in the next fields on pushes... a few others as well...) This seems an aweful lot like a homework assignment...Is it? "Caffeine Junky" wrote in message news:ORJR8.298791$352.29149@sccrnsc02... > 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