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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,978f50245fc02645 X-Google-Attributes: gid103376,public From: Ben Brosgol Subject: Re: Slice and Unbounded String Date: 1996/12/01 Message-ID: <32A2080F.3766@world.std.com>#1/1 X-Deja-AN: 201766192 sender: news@world.std.com (Mr Usenet Himself) references: <01bbdc70$2e557160$262a6282@cln49ae> content-type: text/plain; charset=us-ascii organization: Aonix mime-version: 1.0 reply-to: brosgol@world.std.com newsgroups: comp.lang.ada x-mailer: Mozilla 3.0Gold (Win95; U) Date: 1996-12-01T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Bob Duff said (of the bogus declaration of String_Access in > Ada.Strings.Unbounded): > > "Somebody stuck this in at the last minute, just as a convenience." > > Are you sure of this? Who? And why did it end up so obviously in the > wrong place? With a bogus justification: > > 75 The type String_Access provides a (non-private) access type for explicit > processing of unbounded-length strings. The procedure Free performs an > unchecked deallocation of an object of type String_Access. > > Since the type String_Access has nothing whatsoever to do with the > type Unbounded_String, I find the wording in para 75 incomprehensible. > > Mind you a standard String_Access type would be a VERY helpful addition > to the language, because then everyone could use it easily, and you would > get better interchangable reuse of standard components using this type. > > Ada.Strings would be a good place to put it, since there is almost > nothing there now, but you definitely do NOT want to casually drag > in Strings.Unbvounded just to get this definition. I am the "somebody" whom you can blame (or thank :-) for the presence of String_Access and the accompanying Free procedure in Ada.Strings.Unbounded. Contrary to Bob Duff's comment, this was not done at the last minute (sorry but I recently tossed out my earlier versions of the RM so I can't pinpoint exactly when it was introduced.) The declarations could not go in Ada.Strings since we wanted to keep Ada.Strings Pragma(Pure)-able, and pure packages are not allowed to declare (named) access types. As this thread has suggested, the access type is declared in a predefined package as a convenience to the programmer, since it is quite common to need to deal with access values designating String objects. Whether Ada.Strings.Unbounded is the best place for it is arguable, I suppose, but there did not seem to be a more appropriate home. Ben Brosgol Aonix brosgol@aonix.com