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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!newshosting.com!nx01.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!151.189.20.20.MISMATCH!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <42309456$1@news.broadpark.no> <4232ab3a$0$26547$9b4e6d93@newsread4.arcor-online.net> <1110825790.396769@athnrd02> <1gf23j59mnsm2.wimnrcdrb09u.dlg@40tude.net> <1d7hl8pj8dhsh.m8mjwl7qxs86$.dlg@40tude.net><4236bdab$0$1098$9b4e6d93@newsread2.arcor-online.net> Date: Tue, 15 Mar 2005 13:56:28 +0100 Message-ID: NNTP-Posting-Date: 15 Mar 2005 13:53:00 MET NNTP-Posting-Host: 213fd48e.newsread4.arcor-online.net X-Trace: DXC=j0FnRTKKX07F:^Y;boJ3Y0:ejgIfPPld4jW\KbG]kaM8GSi?jHD8GO0\]A3Fo^W:]9[6LHn;2LCV>7enW;^6ZC`4<=9bOTW=MN> X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9435 comp.lang.c++:45775 comp.realtime:1512 comp.software-eng:5085 Date: 2005-03-15T13:53:00+01:00 List-Id: On Tue, 15 Mar 2005 11:51:33 +0100, Georg Bauhaus wrote: > Dmitry A. Kazakov wrote: > >> I think that the reason is not contracts but inflexible contracts. Ada >> formal generic parameters are not ADTs. So there is no way to define a >> formal generic type Ordered. > > Hm. Do you mean, a contract type cannot be _defined_ in the > generic formal part of a unit? > Otherwise, why not just write > > generic > type Ordered is new Has_Less_Than with private; > package ... > > where Has_Less_Than is an abstract type with a "<" operation. In which case it simple does not need to be generic! Ordered here is a normal ADT, which class is Has_Less_Than'Class. So the package should work directly with the class and be non-generic. End of story. What I meant was: generic type Ordered is Has_Less_Than; -- This is not Ada! package ... Here Has_Less_Than is not a type but a [generic] class of types, like "private", "limited private", "range <>", etc. It is almost same but not the same. This is actually why I strongly believe that generics are superfluous and should be replaced by better ADTs (now normal ones, one storey below). In other words there is no need to make a fuss with types ADT (=classes of formal generic types) when we are far from being ready with the normal ones! -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de