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 Path: g2news1.google.com!news4.google.com!news.glorb.com!news.addix.net!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.news-service.com!post.news-service.com!news1.surfino.com!not-for-mail Message-Id: <1589011.UDoXuOOyIh@linux1.krischik.com> From: Martin Krischik 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 Reply-To: martin@krischik.com Date: Sun, 06 Mar 2005 11:57:48 +0100 References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <87eket97gp.fsf@insalien.org> <422a1f54$0$14972$ba620e4c@news.skynet.be> Organization: None User-Agent: KNode/0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8Bit X-Complaints-To: abuse@surfino.com NNTP-Posting-Host: 83.169.175.19 (83.169.175.19) NNTP-Posting-Date: Sun, 06 Mar 2005 12:00:11 +0100 X-Trace: 166fe422ae2bbf60c0ab610883 Xref: g2news1.google.com comp.lang.ada:8741 comp.lang.c++:44319 comp.realtime:1013 comp.software-eng:4545 Date: 2005-03-06T11:57:48+01:00 List-Id: Adrien Plisson wrote: > Ludovic Brenta wrote: >> The one thing that C++ supports that Ada doesn't is multiple >> inheritance. This feature was left out as unsafe. Interface >> inheritance � la Java is being added in Ada 2005. > there is also one other thing i can think of: template specialization. > this is an interresting construct, used a lot in C++, which gives the > ability to write "traits". there may be a way to do it in Ada but i'm > not aware of it (if there is, please tell me). Yes traits would be tricky - but not impossible. Ada allows for both procedures and packages as generic formal parameter: http://www.adaic.org/standards/95lrm/html/RM-12-6.html http://www.adaic.org/standards/95lrm/html/RM-12-7.html However there are two important differences here which would make traits a typing feast in Ada: 1) Ada generics work on procedures and packages but not classes. A bit like template <...> namespace X {}; 2) Ada genenrics only instanciate explicitly. Well it's a hole namespace with all classes, prodedures, types and data after all. But as I said, not impossible. I have a regex generic which can be instanciated for character and wide character strings and basicly any other descreed type you want to run regular expressing over. With Regards Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com