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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,197f249b225fabe2 X-Google-Attributes: gid103376,public From: johnherro@aol.com Subject: Re: Ada 83 versions of Ada 95 packages Date: 1996/12/24 Message-ID: <19961224155500.KAA09943@ladder01.news.aol.com>#1/1 X-Deja-AN: 205787972 references: <9612232029.AA09783@most> organization: AOL http://www.aol.com newsgroups: comp.lang.ada x-admin: news@aol.com Date: 1996-12-24T00:00:00+00:00 List-Id: "W. Wesley Groleau (Wes)" writes: >I recently had to implement in Ada 83 some >capabilities that are part of the Ada 95 standard >libraries... Is anyone else doing anything similar? To a *very small extent* I did something similar by writing a very small package in Ada 83, which I am happy to contribute to the public domain: ---------- package Ada83_Strings_Unbounded is type Unbounded_String(Length : Integer := 0) is private; function "+"(Right : in String) return Unbounded_String; function "+"(Right : in Unbounded_String) return String; function "&"(Left, Right : in Unbounded_String) return Unbounded_String; private type Unbounded_String(Length : Integer := 0) is record Text : String(1 .. Length); end record; end Ada83_Strings_Unbounded; package body Ada83_Strings_Unbounded is function "+"(Right : in String) return Unbounded_String is Ans : Unbounded_String(Right'Length); begin Ans.Text := Right; return Ans; end "+"; function "+"(Right : in Unbounded_String) return String is begin return Right.Text; end "+"; function "&"(Left, Right : in Unbounded_String) return Unbounded_String is begin return +((+Left) & (+Right)); end "&"; end Ada83_Strings_Unbounded; ---------- Admittedly this package is very small, but to take slices and do other functions, you can easily convert from Unbounded_String to String first. E.g., if U is an Unbounded_String, you can write "+"(U)(1 .. 3) to take a slice. I find this package very useful, and hope others will, too. - John Herro Software Innovations Technology http://members.aol.com/AdaTutor ftp://members.aol.com/AdaTutor