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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,40843b637af826a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.91.199 with SMTP id cg7mr7438868wib.1.1354182675686; Thu, 29 Nov 2012 01:51:15 -0800 (PST) Path: q13ni75341wii.0!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 29 Nov 2012 10:51:27 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: IBM 437 encoded String to UTF-16 Wide_String References: <11112110-03b1-4977-ba80-00204926ea23@googlegroups.com> <68663891-14ad-4780-a00d-1cc48ed75323@googlegroups.com> <027679a1-dc5e-4888-9dd1-2a4ccf32e66c@googlegroups.com> <50b5dcd0$0$6581$9b4e6d93@newsspool3.arcor-online.net> <1mefvxxar8vn3$.16pejjtgf8hhg.dlg@40tude.net> <50b5f60e$0$9524$9b4e6d93@newsspool1.arcor-online.net> <347rnekt4in1.12pbyz0phdelf$.dlg@40tude.net> <50b615d5$0$6584$9b4e6d93@newsspool3.arcor-online.net> <11j81z9v2gr02$.kxnnq6lqzoz$.dlg@40tude.net> <50b64b47$0$6571$9b4e6d93@newsspool3.arcor-online.net> <1e9k8c3tgm89w$.v1ty0n5ucjqv.dlg@40tude.net> In-Reply-To: <1e9k8c3tgm89w$.v1ty0n5ucjqv.dlg@40tude.net> Message-ID: <50b73013$0$6576$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 29 Nov 2012 10:51:15 CET NNTP-Posting-Host: 8de1bc30.newsspool3.arcor-online.net X-Trace: DXC=OloYKXX7>UiJ00P1S40fZgMcF=Q^Z^V3h4Fo<]lROoRa8kFejVhE@;jmfD`k:g<8W2ih96S[g X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-11-29T10:51:15+01:00 List-Id: On 28.11.12 19:00, Dmitry A. Kazakov wrote: >> That is, is there a set difference between string operations >> and "vector" operations such that, from a user's perspective, >> nothing could turn vectors into objects of type String, or >> Wide_String, or Wide_Wide_String? > > Irrelevant, so far Ada's type system was nominal. T1 /= T2 even if there is > no difference between them in terms you described. I have not wanted to suggest structural equivalence or duck typing. Neither will generic formals allow circumventing name equivalence. Matching works (at the not so recent Ada level at least, with GNAT). It's just that - if Ada does not get a complete apparatus for handling all string types in some Root_String'Class, and - if I want my subprograms to work with different types of strings, this particular kind of problem can be solved with the help of a generic formal package that a user of my programs has instantiated, substituting his or her types for its formals. The formal contract of the formal generic package describes a string type whatsoever and this description is sufficient for the subprograms of my generic, and is good enough for the compiler as well. It is not nice, it works in one direction, and it does not cover the same cases that Root_String'Class could cover, but it does solve the problem of making one algorithm work with objects of different types. Propose something better, have it replace current language, and I will switch.