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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,54c513170bafd693 X-Google-Attributes: gid103376,public From: Gautier Subject: Re: Desirability of C++ Date: 2000/05/02 Message-ID: <390E2A20.B647D0D6@maths.unine.ch>#1/1 X-Deja-AN: 618077076 Content-Transfer-Encoding: 7bit References: <390DEC7F.9429C82C@online.no> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 2 May 2000 03:06:42 +0100, mac13-32.unine.ch Organization: Maths - Uni =?iso-8859-1?Q?Neuch=E2tel?= MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-05-02T00:00:00+00:00 List-Id: tmoran@bix.com wrote: > >made the right decision on strings when they selected counted strings for > >Turbo Pascal/Delphi even if they are limited to 255 characters or less. > How do those differ from > ... is new Ada.Strings.Bounded.Generic_Bounded_Length(255); The whole package is for the TP "String[255]" type only. If you have sorts of "String[80]" here, "String[20]" there, and so on, it means an instance of the whole package Ada.Strings.Bounded.Generic_Bounded_Length for each maximum length, with whole code for all operators, with conversion issues, renaming of the different Bounded_String etc.! If you simply define... package BorStrings is type BorString( maxlength: positive ) is private; ... private type BorString( maxlength: positive ) is record length: Natural:= 0; s: String( 1..maxlength ); end record; -- NB: length allows longer strings than the "s[0]" in T/B-Pascal end BorStrings; you can have all of TP strings at once, with one type, one package! In addition, translation from TP/Delphi is much easier "var s: string[255]" -> "s: borstring(255)" "type t_ident=string[100] -> "subtype t_ident is borstring(100)" and so on :-). IMHO the day of creation of Ada.Strings.Bounded was a bad one... _____________________________________________ Gautier -- http://members.xoom.com/gdemont/