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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9e7db243dfa070d7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!y31g2000vbt.googlegroups.com!not-for-mail From: "Chad R. Meiners" Newsgroups: comp.lang.ada Subject: Re: Do people who use Ada also use ocaml or F#? Date: Sat, 6 Nov 2010 20:05:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <87k4kz3mda.fsf@mid.deneb.enyo.de> <5jjgrklivesk$.z0is5qe7mgbt.dlg@40tude.net> <82mxpmz7t3.fsf@stephe-leake.org> NNTP-Posting-Host: 173.48.246.55 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1289099134 22467 127.0.0.1 (7 Nov 2010 03:05:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 7 Nov 2010 03:05:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y31g2000vbt.googlegroups.com; posting-host=173.48.246.55; posting-account=XRGbKgoAAACag8f1Ww4XGf81DDZtyfbX User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:15363 Date: 2010-11-06T20:05:34-07:00 List-Id: On Nov 6, 1:22=A0pm, Stephen Leake wrote: > Robert A Duff writes: > > > "Dmitry A. Kazakov" writes: > > >> How do you execute a generic body? Testable are generic instances. > > > =A0 =A0 You can't test a generic without instantiating it. > > > =A0 =A0 You can't test a procedure without calling it. > > > =A0 =A0 You can't test an abstract type without declaring > > =A0 =A0 a concrete type, and some objects of that type. > > > What am I missing? > > To truly test a generic, you need to test with all possible > instantiations. > > Or at least with a representative subset. If the generic parameters are > well structured, it may be possible to show that a few instances are > sufficient. > > That's much more effort than testing a single concrete procedure. > > It may be worth it, of course; I often use generics precisely to reduce > testing burden. > > -- > -- Stephe No, this really isn't the case. When you write a generic you only need to test it for the cases that you intend to use it. When you attempt to reuse the generic, however, you need to test and verify that the code is appropriate for reuse. To bring this back to the original question, this is almost a mantra of FP. You need to make sure you are using the function (generic) correctly, or you need to modify the function (or generic).