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: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.68.133.65 with SMTP id pa1mr3269699pbb.4.1366381153616; Fri, 19 Apr 2013 07:19:13 -0700 (PDT) Path: bp1ni1480pbd.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!News.Dal.Ca!news.litech.org!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Tue, 16 Apr 2013 10:03:11 +0200 Organization: cbb software GmbH Message-ID: <144bgnv8rdks7$.1o76z1eh196ks$.dlg@40tude.net> References: <1gnmajx2fdjju.1bo28xwmzt1nr.dlg@40tude.net> <3gv2jwc95otm.pl2aahsh9ox8.dlg@40tude.net> <1gkxiwepaxvtt$.u3ly33rbwthf.dlg@40tude.net> <1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net> <1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net> <8bj2k30k7i19.w7ehsldwbf7x.dlg@40tude.net> <1o34nhpfuy6yl$.2orlukd1elr7.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Received-Bytes: 3912 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-04-16T10:03:11+02:00 List-Id: On Mon, 15 Apr 2013 20:41:46 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:gj0dksp3fqws$.15ahjs6oqwquj.dlg@40tude.net... >> On Fri, 12 Apr 2013 19:22:36 -0500, Randy Brukardt wrote: > ... >> And the solution is to remove Append? What would be a "good" design of >> Unbounded_String and String such that you never mixed them? Is there any? > > Not remove Append, but remove the version of Append that mixes two different > types. OK, that is not serious. > The only operations that change types should be explicit conversions > (possibly user-defined versions of that, using functions). Conversions are mixed type operations per definition: function "+" (Value : String) return Unbounded_String; is mixed, and additionally a multi-method if String and Unbounded_String in the same hierarchy with "+" defined there. >> You missing the main point that whatever difference Unbounded_String and >> String may have, it is not a semantic difference. Both are different >> implementations of the same thing. They are mixed right from the start. > > Representation is an integral part of semantics. I don't understand why you are using Ada then. There are lots of great languages which pursue the principle that representation is semantics, beginning with C. > I strongly disagree that > they're representations of the same thing, because that would imply that > they do exactly the same thing for all operations -- and that's clearly not > true. That is certainly true. All operations of these types deal with exactly same thing called "string." Whatever difference existed is motivated solely by implementation reasons, e.g. by memory management issues. These are irrelevant to what string is: a sequence of code points with operations like (), &, <, <=, Put_Line etc. > I'm certain that nothing you want > to see will happen -- it isn't happening by magic. Clearly so, when even separation of implementation and interface is no more considered Ada's design principle. I have no illusions. The trend is obvious when looking at Ada 2005 and 2012. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de