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!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050728 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Aliasing or referencing assignment References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sun, 11 Sep 2005 03:20:50 GMT NNTP-Posting-Host: 4.254.202.67 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1126408850 4.254.202.67 (Sat, 10 Sep 2005 20:20:50 PDT) NNTP-Posting-Date: Sat, 10 Sep 2005 20:20:50 PDT Xref: g2news1.google.com comp.lang.ada:4574 Date: 2005-09-11T03:20:50+00:00 List-Id: David Trudgett wrote: > Without knowing the details of how they work, I was just assuming they > would be pre-elaborated during the compilation process. GNAT in gcc 3.4.2 implements Unbounded_String as package AF renames Ada.Finalization; Null_String : aliased String := ""; type Unbounded_String is new AF.Controlled with record Reference : String_Access := Null_String'Access; Last : Natural := 0; end record; and To_Unbounded_String as function To_Unbounded_String (Source : String) return Unbounded_String is Result : Unbounded_String; begin Result.Last := Source'Length; Result.Reference := new String (1 .. Source'Length); Result.Reference.all := Source; return Result; end To_Unbounded_String; Other implementations are possible. -- Jeff Carter "I'm a lumberjack and I'm OK." Monty Python's Flying Circus 54