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,f51594afc8ac17fd X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Need help with code? Date: 1997/12/15 Message-ID: #1/1 X-Deja-AN: 298490297 X-NNTP-Posting-Host: pogner.demon.co.uk [158.152.70.98] References: <66m904$naj$1@usenet48.supernews.com> Organization: At Home Newsgroups: comp.lang.ada Date: 1997-12-15T00:00:00+00:00 List-Id: "Eric Sabo" writes: > Can someone tell what am I doing wrong with this code? > ----------------------- begin ---------------------------------------- > generic > type item_type is private; > procedure push(x : in out item_type); > procedure push(x : in out item_type) is > type item_node; > type item_ptr is access item_node; type item_node is <<<<<<<<<<< > record > item : item_type; > next : item_ptr; > end record; and again, about 6 times altogether. I found these fairly easily while using gnatchop to split your source up into individual files .. and then there are some more problems with the code (eg, at the end you're calling the generic push rather than the instantiated rec_push or whatever) .. and why have you separated push, pop etc into separate generic subprograms rather than making them members of one generic {stack? list? what?} package? I think you (and we) would find it a lot easier to see what you were about if you would lay your code out neatly. I don't know what editor you're using, emacs has a neat auto-indent feature. If you don't have such an editor, it's often worth closing the structure before putting in the contents; eg, (stage 1) begin (stage 2) begin end; (stage 3) begin stuff .. end; -- Simon Wright Work Email: simon.j.wright@gecm.com GEC-Marconi Radar & Defence Systems Voice: +44(0)1705-701778 Command & Information Systems Division FAX: +44(0)1705-701800