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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a315126e5fc76ced X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-22 01:04:28 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!dearn!blekul11!ccsdec1.ufsia.ac.be!reks.uia.ac.be!idefix.CS.kuleuven.ac.be! Belgium.EU.net!EU.net!news.sprintlink.net!cs.utexas.edu!swrinde!gatech!news-feed-1.peachnet.edu!paperboy.wellfleet.com!noc.near.net!inmet!henning!stt From: stt@henning.camb.inmet.com (Tucker Taft) Subject: Re: Simplifying Unbounded_Stri Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. X-Newsreader: TIN [version 1.1 PL8] References: <3khc1s$2bt@dmsoproto.ida.org> Date: Wed, 22 Mar 1995 05:21:20 GMT Date: 1995-03-22T05:21:20+00:00 List-Id: David Wheeler (wheeler@ida.org) wrote: : I'm looking for some advice on how to simplify Unbounded_String : handling. Discussion and source code follows. .. I would recommend the following: with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Unbounded_Converters is function "+"(From : String) return Unbounded_String renames To_Unbounded_String; function "+"(From : Unbounded_String) return String renames To_String; end Unbounded_Converters; And then a user of unbounded strings can: with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Unbounded_Converters; use Unbounded_Converters; Now they have a convenient unary operator "+" for converting back and forth between unbounded strings and strings, meaning that there is no particular reason to create separate routines for unbounded string output. You might still want a version of Get_Line which didn't bother to go through String, so you might want to add this to your package. I don't see the need to define a child package, and as you mention, implementations are allowed to limit the creation of child packages of implementation-provided packages (though I doubt that many will impose such limitations). -Tucker Taft stt@inmet.com Intermetrics, Inc.