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: 103376,2f1406ca802cdec5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Sat, 10 Sep 2005 06:27:56 -0500 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Aliasing or referencing assignment References: Date: Sat, 10 Sep 2005 13:28:16 +0200 Message-ID: <87slwdp3fz.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:YaoG8xEUcNmDi46++Rf1hNHqvnI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 83.134.245.139 X-Trace: sv3-ymk3B/fVd13qThFW8gcC8HQQmuBD9XNOiyu3tt7OEtA3wsEGHedpPMdal2FdIEBFyvPkiVBYY3g+69z!S/08cN4RQ45xxTDAKaRlqRyHeEWeqRC2IVYRQBSVCKUsnmvaqxmxsIqJD/sK0cxhpILy2BZXcXs= X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:4566 Date: 2005-09-10T13:28:16+02:00 List-Id: David Trudgett writes: > Without knowing the details of how they work, I was just assuming > they would be pre-elaborated during the compilation process. Internally, they may be implemented by an array and a used length. When the used length grows beyond the length of the array, the array is reallocated to grow in size. The complexity of this is probably just above what can be preelaborated automatically. You can have preelaborated unbounded strings if they are constant and you declare them in a package which is preelaborated, e.g. with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Constants is pragma Preelaborate; -- or better yet, Pure function "+" (R : in String) return Unbounded_String renames To_Unbounded_String; S : constant Unbounded_String := +"Some fixed string"; end Constants; HTH (The above package can be declared Pure. In addition to being preelaborated, Pure packages promise that they have no side effects: no visible global variables, no access parameters, and no use of System.Address.). -- Ludovic Brenta.