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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99fa0d024c5a6500,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-25 15:22:25 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!caen!msuinfo!netnews.upenn.edu!gopher.cs.uofs.edu!guinness.cs.uofs.edu!beidler From: beidler@guinness.cs.uofs.edu (Jack Beidler) Newsgroups: comp.lang.ada Subject: Generic Child Packages Date: 25 Oct 1994 19:32:40 GMT Organization: Department of Computing Sciences Distribution: world Message-ID: <38jmgo$3f5@gopher.cs.uofs.edu> NNTP-Posting-Host: guinness.cs.uofs.edu Date: 1994-10-25T19:32:40+00:00 List-Id: I have been working, with some success with gnat 1.83 on both a UNIX and an MS-DOS environment. I've encountered a little problem with generic child packages. I've tried the usual solutions (a la Barnes p439) to no avail. I'm wondering if anyone has had success instantiating a generic child package with gnat 1.83, or might have an idea that overcomes my current block. The example is as follows: I decided to begin with an Ada83 package and break it up into a parent and two child units. The parent is called stack_pt_lpt (stacks are instantiated with a private type and stack_type is made visible as a limited private type). The Ada83 version of this package works perfectly under gnat 1.83. The new version is stack_pt_lpt (contains only pure stack support), stack_pt_lpt.advanced (contains peek, poke, and other "non pure" features, and stack_pt_lpt.iterators (contains two iterators called bottom_up and top_down). All three have been successfully "compiled" in gnat (i.e. the ".o" files were formed). The question is: how does one instantiate the child units in gnat 1.83? Such obvious replys, like separate instantiation outside of a procedure, e.g. the old classical with text_io; package iio is new text_io.integer_io(integer); (which by the way does not work with gnat 1.83) does not work in gnat 1.83 for inclusion in the library, but will work in a procedure (program). with text_io, Stack_Pt_Lpt.Iterators; procedure xcxrev is package tio renames text_io; -- if the following instantiates the "parent" stack package -- which it does in gnat 1.83 package Stk is new Stack_Pt_Lpt (character); -- fill in the blanks to instantiate the the iterators child unit package ___________________ is new __________________________; Buffer: string (1..255); B_Size: natural; . . . --rest of procedure end xcxrev; Postscript: I just recieved the following from Brad Balfour about this problem. > Jack, > > I just look at my bug submissions for Gnat and found that I had reported a > different error message bug for the same feature in v.1.80 in June. I just > received a note last week that the bug (assigned to comar with tracking number > [0614-001]) is fixed in 1.84. You might want to forward our last two notes to > gnat-report@cs.nyu.edu and ask them to verify that this will now work under > 1.84. > > Brad -- +----------------------------------------+------------------------+ |John (Jack) Beidler ++ beidler@cs.uofs.edu | | Professor, Computing Sciences Dept. ++ | | University of Scranton ++ (717) 941-7446 (voice) | | Scranton, PA 18510 ++ (717) 941-4250 (FAX) | +------------------------------------+----------------------------+