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,8fdcbb4347c7f20a,start X-Google-Attributes: gid103376,public From: Dale Stanbrough Subject: Instantiation of child generics? Date: 1996/07/26 Message-ID: <4t9itp$imd@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 170199633 distribution: world content-type: text/plain; charset=ISO-8859-1 x-xxmessage-id: organization: RMIT, Melbourne, Australia mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-07-26T00:00:00+00:00 List-Id: Hi, I'ld like to create an abstract generic queue package with bounded and unbounded children. However I have been thwarted in all attempts to instantiate them. Also I don't really understand the rules for instantiaion of child generics. Can anyone explain them? e.g. generic type element is private; package queues is type queue is abstract tagged null record; procedure init return queue is abstract; procedure enqueue(item:in out queue; item:element) is abstract; -- etc end queues; generic size :natural; package queues.bounded is type queue is new queues.queue with private; procedure init return queue is abstract; procedure enqueue(item:in out queue; item:element) is abstract; private type queue is new queues.queue with null record; -- for now... end; How do I instantiate this? with queues.bounded; package myQ is new queues.bounded(integer, 5); results in Gnat telling me "invalid prefix in selected component "queues"" Also will my (re)use of the identifier "queue" in the packages cause any problems for me? It seems to compile ok, but i'm concerned that there might be some nasty visibility issue lurking around the corner... Thanks, Dale