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 Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin1!goblin.stu.neva.ru!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Sat, 13 Apr 2013 09:07:13 +0200 Organization: cbb software GmbH Message-ID: <1mj139j8qmngc.tazh0b903w0q.dlg@40tude.net> References: <1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net> <1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net> <4hzv51v872q2$.1imijbwd7heqm$.dlg@40tude.net> <1htu9idmcci7x.1vr9eafeivqah$.dlg@40tude.net> <1q6gm7foi87kr.i2q54bm8sy83.dlg@40tude.net> <6ywdes8pgbd8$.alujya2d4454$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: rHWOzyHApalsT5sEUcbvVQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 5016 Xref: number.nntp.dca.giganews.com comp.lang.ada:181048 Date: 2013-04-13T09:07:13+02:00 List-Id: On Fri, 12 Apr 2013 19:35:07 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:6ywdes8pgbd8$.alujya2d4454$.dlg@40tude.net... >> On Thu, 11 Apr 2013 17:37:31 -0500, Randy Brukardt wrote: >> >>> "Dmitry A. Kazakov" wrote in message >>> news:1q6gm7foi87kr.i2q54bm8sy83.dlg@40tude.net... >>> ... >>>> In that case there is simply no alternative to multi-methods because n-ary >>>> operations do not have preferable argument. So what are you going to do >>>> with this? You ditch operations, literals, slices. A great theory! >>> >>> Yup, operations that you don't need, and that are dangerous on top of that. >>> You continually claim that you need multi-methods without a shred of proof. >> >> The list of operations required for strings was listed many times: >> >> function "&" (L, R : Root_String_Type) return Root_String_Type; >> function "=" (L, R : Root_String_Type) return Boolean; >> function "/=" (L, R : Root_String_Type) return Boolean; >> function ">=" (L, R : Root_String_Type) return Boolean; >> function "<=" (L, R : Root_String_Type) return Boolean; >> function ">" (L, R : Root_String_Type) return Boolean; >> function "<" (L, R : Root_String_Type) return Boolean; >> function Overwrite (Source : in Root_String_Type); >> Position : in Positive; >> New_Item : in Root_String_Type) >> return Root_String_Type); >> >> should I continue? It is hundreds of operations, literally. > > Hundreds? You've lost your mind. My rough proposal had 6 (not counting the > operators). The vast majority of interesting operations should be > class-wide, not primitive. That includes pretty much everything in the > Ada.Strings.whatever packages. Ada 95 already has Wide_Wide_String packages. For fans of explicit conversions everything is there. Why bothering with new hierarchies? [And repeating old mistakes?] >>Take into >> account a huge set of multi-dispatch operation with containers of strings, >> e.g. Character_Set and Character_Mapping. It is thousands of operations >> you want to overload? Drop altogether? > > I don't see this at all. The element type here is Wide_Wide_Character > (only), since this is all about Unicode and there's no important reason to > shorten the representation of singletons. So there's no multi-dispatch and > all of the existing character sets and mappings can be used as they > currently are defined. Translating String using a Wide_Wide mapping is a mixed operation! >>> Changing/comparing different representations is something that a program >>> should do very rarely, if at all. >> >> Give "a shred of proof" that Wide_Wide_String must have same >> representation as String. > > It doesn't have the same representation; they should never be used together. > Give me any reason (beyond existing broken interfaces, which we would fix) > that you should be mixing these two types. The reason is that Wide_Wide_String and String represent exactly same thing. The motivation to have String is exclusively optimization. Same applies to Unbounded_String and to encodings. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de