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-Thread: 103376,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!aioe.org!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: Interfacing Ada with C Date: Fri, 06 Aug 2010 20:46:37 -0400 Organization: The Wasteland Message-ID: References: <143ef70b-7e74-426b-a621-a5fd157849be@x21g2000yqa.googlegroups.com> <06eb8f61-2a0c-4dda-93f3-8414d32b6e4f@f20g2000pro.googlegroups.com> <87pqxwrwtz.fsf@hugsarin.sparre-andersen.dk> <1t7qv7gn9gugg$.alpj3tkmkw1y$.dlg@40tude.net> <1hpn479yuv29e.1ryblciqi0msh.dlg@40tude.net> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: g2news1.google.com comp.lang.ada:12919 Date: 2010-08-06T20:46:37-04:00 List-Id: In article , Simon Wright wrote: [...] > >> The thought process was, "I'm going to be writing a set of demo > >> cases which should work for arbitrary floating-point types, I'll > >> call the type My_Float. Shall I use type My_Float is new ... or > >> subtype My_Float is ...? Doesn't really matter, go for subtype." > > > > I am not sure what do you mean. If the code meant to be used with > > any type, then it should be generic (My_Float is digits <>). If the > > code is to work with some yet unknown type (to be determined later) > > then it should be My_Float is new Long_Float. That would protect me > > from mixing Long_Float and My_Float. > > You're clearly right for serious code (in this case, for serious unit > tests which I may well make generic). But this wasn't a serious test, > it was an exploratory hack. Perhaps I shouldn't have let it out into > the wild without a bit more polishing. No! Release Early, Release Often: > I do feel that writing a demo like this one as a set of generics > instantiated for various floating types would probably have obscured > the point. -- John B. Matthews trashgod at gmail dot com