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: 103376,dc1fff2721602dfa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.19.132 with SMTP id f4mr779599wie.2.1359739390603; Fri, 01 Feb 2013 09:23:10 -0800 (PST) Path: i11ni33463wiw.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada and string literals Date: Fri, 1 Feb 2013 18:23:00 +0100 Organization: cbb software GmbH Message-ID: <1l8gd32wspyy5$.1u81easl2psqm$.dlg@40tude.net> References: <4978d638-a04b-4561-85e9-cf6620265af2@googlegroups.com> <85wqus1887.fsf@stephe-leake.org> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: cDN0fd8KlIeJLyErIrSf0A.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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-02-01T18:23:00+01:00 List-Id: On Fri, 01 Feb 2013 08:20:24 -0500, Stephen Leake wrote: > That's what "+" is for: > > function "+" (Item : in String) return access constant String > is begin > return new String'(Item); > end "+"; > > Colors : constant String_Sequence := > (+"red", -- This _is_ Ada! > +"orange", > +"dark green", > ...); What about: function "&" (Left, Right : String) return String_Sequence is begin return (new String'(Left), new String'(Right)); end "&"; function "&" (Left : String; Right : String_Sequence) return String_Sequence is begin return String_Sequence'(1 => new String'(Left)) & Right; end "&"; Colors : constant String_Sequence := "red" & "orange" & "dark green"; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de