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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,51b151b4d322b1cc X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: ada.strings.unbounded "free" and "String_Access" Date: 2000/03/08 Message-ID: <38c6de74@eeyore.callnetuk.com>#1/1 X-Deja-AN: 594917139 References: <38C5B5AD.D310C559@mindspring.com> X-Original-NNTP-Posting-Host: da130d71.dialup.callnetuk.com X-Trace: 8 Mar 2000 23:12:52 GMT, da130d71.dialup.callnetuk.com X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Date: 2000-03-08T00:00:00+00:00 List-Id: The purpose is simply this: if Unbounded_String doesn't give you quite enough flexibility in certain parts of your code (e.g. you need more speed), you can use the type String_Access instead. You may well employ the following strategy: convert value(s) of type Unbounded_String to type String_Access (using the To_String function and the 'new' allocator); operate on the String_Access object(s) as required; convert the result(s) back to type Unbounded_String (using the To_Unbounded_String function). This way, you can use the more encapsulated type Unbounded_String in most of your code, and only use the lower-level String_Access type where you really need to. The function Free is provided for you to explicitly deallocate the String_Access object(s) if you want to (or need to). Really, the type String_Access, and the function Free, are provided purely as a convenience. They could easily have been omitted (to be declared incidentally instead), but that was obviously felt to be just a little too inconvenient by the designers of Ada 95 (and I agree with them). -- Nick Roberts http://www.adapower.com/lab/adaos "Al Johnston" wrote in message news:38C5B5AD.D310C559@mindspring.com... > ... > But I was wondering... why is the type "ada.strings. > unbounded.string_access" as well as a "free" routine > for this type, provided in the spec of unbounded.strings?