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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38c827f7e800d317 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-27 19:58:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3EFD0424.4000905@spam.com> From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: conversion References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 28 Jun 2003 02:55:33 GMT NNTP-Posting-Host: 63.184.9.13 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1056768933 63.184.9.13 (Fri, 27 Jun 2003 19:55:33 PDT) NNTP-Posting-Date: Fri, 27 Jun 2003 19:55:33 PDT Xref: archiver1.google.com comp.lang.ada:39860 Date: 2003-06-28T02:55:33+00:00 List-Id: Andrew wrote: > Ok, so I found the ada.strings.unbounded package spec and body and took a > look > at the definition and implementation of unbounded string. Finally I found > them! > > Unbounded_string is basically an object that contains a reference to a > string. What you are discussing is one specific compiler's implementation of Ada.Strings.Unbounded.Unbounded_String. Other compilers may use other implementations. This may seem unlikely, but some compilers might treat objects of this type as a special case in order to speed up the memory management required for them. Ada has so many ways to use type String that there are few cases when a variable-length string type is really needed. Many cases where other languages need a variable string can be handled very easily by Ada's type String, and many uses of Unbounded_String in Ada are more examples of laziness or unfamiliarity with Ada's capabilities than of a real need for a variable string. This is similar to the case of pointers. Access types are needed much more rarely in Ada than in many other languages, especially C. People who are using a lot of access types, objects, and values in Ada are probably using the language ineffectively, frequently because that's the way they're used to doing things in other languages. -- Jeff Carter "I'm a lumberjack and I'm OK." Monty Python's Flying Circus