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.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4c86cf2332cbe682 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-12 07:59:45 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!news.sprintlink.net!hookup!olivea!uunet!newsgate.watson.ibm.com!watnews.watson.ibm.com!ncohen From: ncohen@watson.ibm.com (Norman H. Cohen) Newsgroups: comp.lang.ada Subject: Re: Ada.strings.bounded problems? Date: 12 Jan 1995 15:59:45 GMT Organization: IBM T.J. Watson Research Center Distribution: world Message-ID: <3f3jlh$kts@watnews1.watson.ibm.com> References: Reply-To: ncohen@watson.ibm.com NNTP-Posting-Host: rios8.watson.ibm.com Date: 1995-01-12T15:59:45+00:00 List-Id: In article , tarjeij@ulrik.uio.no (Tarjei Jensen) writes: |> How can anybody create generic string packages when there is an abundance of |> bounded string types around and none are compatible? It looks like a mess to |> me. I am used to think of (bounded) strings much like integers; they come in |> different sizes, but are basically compatible. Answer 1: Base it on unbounded strings instead. Answer 2: Use generic formal packages: with Ada.Strings.Bounded; generic package Bounded_String_Instance is new Ada.Strings.Bounded.Generic_Bounded_Length (<>); package Generic_Additional_Bounded_String_Facilities is ... end Generic_Additional_Bounded_String_Facilities; Use of the package: ------------------- with Ada.Strings.Bounded; package Bounded_80 is new Ada.Strings.Bounded.Generic_Bounded_Length(80); with Bounded_80, Generic_Additional_Bounded_String_Facilities; pragma Elaborate (Generic_Additional_Bounded_String_Facilities); package Additional_Bounded_80_Facilities is new Generic_Additional_Bounded_String_Facilities (Bounded_80); with Bounded_80, Additional_Bounded_80_Facilities; procedure Client is ... end Client; -- Norman H. Cohen ncohen@watson.ibm.com