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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f7a9613bbc2bd8c9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-10 21:05:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!newsfeed.online.be!130.240.42.8.MISMATCH!luth.se!psiuk-p2!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Generic default parameters Date: Fri, 10 May 2002 12:50:52 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1021049454 27325 136.170.200.133 (10 May 2002 16:50:54 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 10 May 2002 16:50:54 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:23883 Date: 2002-05-10T16:50:54+00:00 List-Id: For the same reason that (in effect) you can have a "default value" for functions. You say you want a "<" function and with the "is <>" part you are saying, "But if one is already defined and you don't need to override it for any reason, then you can save yourself the effort." In your example, this is fine for a generic where you want only one parameter to default (or all parameters to default). What if you have 5 parameters and only two of them can sensibly have a default? You can't pre-instantiate with just the two parameters. (Although this might pose a solution that requires no new syntax..... Hmmm......) In the case of Lists, the type of element you're storing should never default because it doesn't make sense. However the data type of a returned element count might sanely default to Natural unless the user has something else in mind. How would you pre-instantiate that with a default value when you have no default element type? MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com "Preben Randhol" wrote in message news:slrnadnts9.42d.randhol+abuse@kiuk0156.chembio.ntnu.no... > > I actually like that Ada95 doesn't allow a default value, and I don't > understand what the gain is in a default value. Expecially not for > generic pacakges. If one want a default value why don't just do: > > package Some_Package is > new Some_Generic_Pacakge (Data_Type => Some_Default_Type); > > in a package and use this? > > Preben