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-11 02:39:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Generic default parameters Date: 11 May 2002 10:29:50 +0100 Organization: Pushface Sender: simon@smaug Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk X-NNTP-Posting-Host: pogner.demon.co.uk:62.49.19.209 X-Trace: news.demon.co.uk 1021109934 nnrp-12:12996 NO-IDENT pogner.demon.co.uk:62.49.19.209 X-Complaints-To: abuse@demon.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: archiver1.google.com comp.lang.ada:23886 Date: 2002-05-11T10:29:50+01:00 List-Id: "Marin David Condic" writes: > 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? I think what you're discussing here is related to "traits" in the C++ world??? (something that's a black mystery to me). Or perhaps it's "partial specialization". Anyway, this would be very useful, I think, in simplifying a complex generic arrangement like the BCs'.