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,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/09/06 Message-ID: #1/1 X-Deja-AN: 388347431 Sender: matt@mheaney.ni.net References: <6qfp80$p0u$1@nnrp1.dejanews.com> <35CD0A8E.21D64380@sprintmail.com> <35CEBAAF.B9B82820@sprintmail.com> <35F0E019.DAAE4635@sprintmail.com> <35F14E7B.79A8DEE@sprintmail.com> NNTP-Posting-Date: Sun, 06 Sep 1998 00:18:39 PDT Newsgroups: comp.lang.ada Date: 1998-09-06T00:00:00+00:00 List-Id: "John G. Volan" writes: > > generic > > type Item_Type is private; > > package Stacks_Bounded is > > type Stack_Type (Capacity : Positive) is ... private; > > ... > > private > > type Items_Type is > > array (Positive range <>) of Item_Type; > > type Stack_Type (Capacity : Positive) is ... > > record > > Top : Natural := 0; > > Items : Items_Type; > > -- Woops! Of course, that should be: > Items : Items_Type (1 .. Capacity); > > > end record; > > end Stacks_Bounded; > The reasons for using a generic formal object as the size vs passing it in as a discriminant are explicated in the Ada95 Rationale.