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 autolearn=ham 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.180.95.3 with SMTP id dg3mr3642134wib.4.1366082472806; Mon, 15 Apr 2013 20:21:12 -0700 (PDT) MIME-Version: 1.0 Path: hg5ni6313wib.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.teledata-fn.de!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Root_String'Class? (Was: Is this expected behavior or not) Date: Wed, 10 Apr 2013 16:48:31 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1gkxiwepaxvtt$.u3ly33rbwthf.dlg@40tude.net><1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net><1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net><4hzv51v872q2$.1imijbwd7heqm$.dlg@40tude.net><1htu9idmcci7x.1vr9eafeivqah$.dlg@40tude.net> <8761zuizmq.fsf_-_@adaheads.sparre-andersen.dk> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1365630517 6627 69.95.181.76 (10 Apr 2013 21:48:37 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 10 Apr 2013 21:48:37 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2013-04-10T16:48:31-05:00 List-Id: "Jacob Sparre Andersen" wrote in message news:8761zuizmq.fsf_-_@adaheads.sparre-andersen.dk... > Randy Brukardt wrote: > > [ many interesting things about string types ] > > You mention creating an abstract tagged Root_String type and deriving > actual string types from it. Do you have some concrete ideas for how > you would do it? Could it be done with what we have in Ada 2012? Or > would it require some extensions to the language? There is a rough proposal in the body of AI12-0021-1/01. Please note that this is completely my invention which has not be vetted by anyone. The only needed magic is to allow string literals for the root type. Everything else needed is already provided by Ada 2012. (Note that I turned slices into functions, we'd need an extra facility to support the slice syntax. I don't find that important enough to bother with, but perhaps others will disagree.) Most of the less-primitive operations would primarily be supported via Ada.Strings.General (which would be similar in contents to Ada.Strings.Fixed). One imagines that types similar to Unbounded_String and Bounded_Striing would also be provided as members of Root_String'Class, so they would have much smaller packages and would be much more interoperable. The downside is that elements would be accessed as Wide_Wide_Characters, which in some cases (16-bit processors, for instance) would make things more expensive than currently. And of course, a lot more dispatching. Randy.