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,30fad28eb8886cca X-Google-Attributes: gid103376,public From: brashear@ns1.sw-eng.falls-church.va.us (Philip Brashear) Subject: Re: parameterless generics? Date: 1996/07/12 Message-ID: <4s5cnp$gq2@ns1.sw-eng.falls-church.va.us>#1/1 X-Deja-AN: 167972328 sender: Phil Brashear references: <4s48k9$3be$1@mhafn.production.compuserve.com> organization: None newsgroups: comp.lang.ada Date: 1996-07-12T00:00:00+00:00 List-Id: In article <4s48k9$3be$1@mhafn.production.compuserve.com>, Brian Gilbert <71413.1453@CompuServe.COM> wrote: >Does anybody have a reason to use a generic (package or >subprogram) without a parameter? The language (Ada 83 at least) >seems to allow it, but everytime the generic is instantiated it >would produce an identical copy. Comments? > >Brian Gilbert >71413.1453@compuserve.com Sure: I've used a generic package to represent ONE OBJECT of an Abstract Data Type (say Stack). [But I also think that it would have been better to use a generic type parameter so that I could have made stacks of XX.] The idea is that the basic structure (the stack body) is in the package body. If your instantiation is called My_Stack, then you write calls like "My_Stack.Push (Thing);", "if My_Stack.Is_Empty then", etc. Some people feel more comfortable with such syntax. Anywho, it's an example. Phil Brashear