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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8e7ac81a215f128c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Using Red-Black Trees Date: Thu, 18 Nov 2010 00:39:19 +0100 Organization: Ada @ Home Message-ID: References: <2419e829-6f45-4075-9005-b9876beb8aaa@r6g2000vbf.googlegroups.com> <46306fd9-21dc-40df-88e7-fc7e568399a4@k11g2000vbf.googlegroups.com> NNTP-Posting-Host: w00cPq0BvzOlRCSRJJEoeQ.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.63 (Win32) Xref: g2news2.google.com comp.lang.ada:16536 Date: 2010-11-18T00:39:19+01:00 List-Id: Le Thu, 18 Nov 2010 00:15:11 +0100, Vinzent Hoefler = <0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de> a =C3=A9crit: >> How do you get, with Ada, something similar to what you have with SML= , I >> mean multiple structures all implementing a same signature ? >> Unfortunately, with Ada, there is no way to do it without = >> tagged/interface >> types (if a package interface specifies operations, then it must a = >> package >> body which implements, =E2=80=A6 in one way only). > > There are still separates. Of course, it's a compile time decision and= it > would be part of the build system, not the language itself. You can have only one at a time. If you select an implementation, you = select it system-wide, and you cannot select one for that usage and = another for another usage in the same system. > So where's the problem? Provide an abstract type with the proper = > operation > set and let the user call a factory function which selects between = > different > implementations provided by the different children. This probably = > introduces > code bloat, because all possible implementation would need to be = > included in > the final executable, but well, you can't have everything, can you? The problem is that this is a lack of orthogonality, which is surprising= ly = an Ada famous feature (Ada forget this one). This is the same issue as t= he = one you get with language with which classes is the only way to achieve = = encapsulation. With these, you end to use classes when you do not need i= t = at the first place and indeed needed package instead. Here, I would like= = to be able to do something which has nothing at all to deal with = polymorphism, and I cannot do it without polymorphism because Ada do not= = provide orthogonality here. This is not better than some usage of classe= s = in C++ to workaround the lack of packages in C++. Would be nice to not b= e = forced to use polymorphism for something which has nothing of = polymorphism. Would like package specification, to be the specification = of = any one implementation, instead of the specification of only one = implementation. In less words, would like Ada package specification to b= e = more abstract; just like you can have multiple entities, all instance of= a = type, would be nice to be able to have multiple implementations, all = instance of a specification. -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens. =E2=80=9CI am fluent in ASCII=E2=80=9D [Warren 2010]