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.8 required=5.0 tests=BAYES_00,INVALID_DATE 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-13 10:52:50 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!pipex!sunic!trane.uninett.no!nntp.uio.no!nntp.uio.no!tarjeij From: tarjeij@ulrik.uio.no (Tarjei Jensen) Newsgroups: comp.lang.ada Subject: Re: Ada.strings.bounded problems? Date: 13 Jan 95 10:52:50 Organization: University of Oslo, Norway Distribution: world Message-ID: References: <3f3rl7$kts@watnews1.watson.ibm.com> NNTP-Posting-Host: ulrik.uio.no In-reply-to: ncohen@watson.ibm.com's message of 12 Jan 1995 18:16:07 GMT Date: 1995-01-13T10:52:50+00:00 List-Id: In article <3f3rl7$kts@watnews1.watson.ibm.com> ncohen@watson.ibm.com (Norman H. Cohen) writes: > This is definitely a weakness of Jensen's understanding of Ada. > > There IS a way to implement bounded strings with the bound given as a > constraint, so simple that it is found in many introductory examples: > > package Bounded_Strings is > type Bounded_String (Max_Length: Positive) is private; > ... -- all sorts of useful operations > private > type Bounded_String (Max_Length: Positive) is > record > Current_Length : Natural := 0; > Text : String (1 .. Max_Length); > end record; > end Bounded_Strings; > The problem is not to find _a_ defininition. The problem is to have _one_ standard variable length bounded_string type that can be used by all packages (libraries). There should be no need for me to edit packages to make them use my personal bounded string type (and I don't want to end up with nearly all modules being generic). Greetings, -- // Tarjei T. Jensen // tarjeij@ulrik.uio.no || +47 51 563411 // Support you local rescue centre: GET LOST! // Working, but not speaking for the Norwegian Hydrographic Service.