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.8 required=5.0 tests=BAYES_00,FREEMAIL_FROM, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b6d862eabdeb1fc4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Ada noob here! Is Ada widely used? Date: Sun, 06 Jun 2010 13:06:45 +0200 Organization: Ada At Home Message-ID: References: <0e88de66-128c-48fd-9b9f-fdb4357f318a@z17g2000vbd.googlegroups.com> NNTP-Posting-Host: nOz3PrZI1lJ+TrIP91FCvA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news2.google.com comp.lang.ada:12319 Date: 2010-06-06T13:06:45+02:00 List-Id: Le Sun, 06 Jun 2010 11:22:07 +0200, Dmitry A. Kazakov = a =C3=A9crit: > But if you force yourself to instantiate earlier, you get a very fragi= le Don't see a reason why ; and this even seems contradictory to me: the = earlier you instantiate, the less complex it is. Or not ? > design. Generics are against good design. Suppose that is true, then this suggest to choose to use generic is a ba= d = design choice. An example objection could be, when a generic is used, = other ways may have been evaluated and excluded for some reasons. Or is = = Ada missing something so that people don't have any other choice than = generic (generic as a fall-back) ? What could this other paradigm could = = looks like then ? (George would be interested in this I suppose) In the area of other choices, would automatic generation or simply copy = be = a better choice (as this is one of the cases generics avoid) ? I feel it= = would be even less usable. Your comments suggest this interesting question about what could be = alternatives to generics. > Add here that generics are non-testable. You can test instances, you > cannot generics. Then Ada has been drifting towards C++ in the sense > what promises gives you a successful compilation of the generic > body, little, very little, nothing... (another matter this one) This is not like if generics could be instantiated with anything. = Actually, this is not: you can require a formal parameter to be a discre= te = type, to be derived from another type, etc. So some assertions can be ma= de = on the validity of a generic's logic and implementation. Perhaps you are= = requesting for more ways to constrain formal parameters ? (I would agree= = with you, unless SPARK already support generics, which I have still not = = tested so far). Oops, I have implicitly replaced =E2=80=9Ctestable=E2=80=9D by =E2=80=9C= provable=E2=80=9D, hope you don't = mind. -- = There is even better than a pragma Assert: a SPARK --# check. --# check C and WhoKnowWhat and YouKnowWho; --# assert Ada; -- i.e. forget about previous premises which leads to conclusion -- and start with new conclusion as premise.