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,9fb64e4c58f1fe X-Google-Attributes: gid103376,public From: guerby@gnat.com (Laurent Guerby) Subject: Re: overload ":=" ??? Date: 1996/07/22 Message-ID: #1/1 X-Deja-AN: 170112026 sender: guerby@schonberg.cs.nyu.edu references: <4soh73$56h@newsbf02.news.aol.com> organization: New York University reply-to: guerby@gnat.com newsgroups: comp.lang.ada Date: 1996-07-22T00:00:00+00:00 List-Id: Laurent> This "sort of string" is built in Ada 95 under the name Laurent> Bounded_String. David> I looked at that, and it would be great, but... RM A.04.04.106 David> seems to say that this isn't good with dynamic pointers (or am David> I misreading this?) First, here is the GNAT implementation of Bounded_String: private type Bounded_String is record Length : Length_Range := 0; Data : String (1 .. Max_Length); end record; So I guess it's very close to what you want, with a big bonus, all Ada 95 String handling routines are waiting to be used. Note that you'll need to instanciate a generic to use it. Second, A.4.4(106) is an "implementation advice" which states: RM> Implementation Advice RM> RM> 106 Bounded string objects should not be implemented by implicit pointers RM> and dynamic allocation. As far as I understand it, it advices (not requires) compiler writers not to use a pointer and "new" to implement this type (this kind of stuff is for Unbounded_Strings). This is not at all a concern to the user, who sees only "type Bounded_String is private". David> what about "write-ability" ???? Please define "write-ability" (I don't want to assume it's related to the number of characters to type ;-). David> This signature will self-destruct in 10 seconds... Boom ;-). -- Laurent Guerby , Team Ada. "Use the Source, Luke. The Source will be with you, always (GPL)."