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,98dbc8f279df5afc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-10 10:57:49 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: A nongeneric bounded string array type Date: 10 Oct 2003 13:48:22 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3F86E9DE.4070000@comcast.net> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1065808295 27784 128.183.235.92 (10 Oct 2003 17:51:35 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 10 Oct 2003 17:51:35 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:636 Date: 2003-10-10T17:51:35+00:00 List-Id: "Robert I. Eachus" writes: > Warren W. Gay VE3WWG wrote: > >> One of the things that discourages me from using Bounded_Strings is >> the number of instantiations that you end up making (for each >> different string size). I would have preferred one instantiation, >> and then a discriminant that set the maximum size on the object. >> But that may have problems of its own. > > Ask, and it shall be given unto you; seek, and you shall find; knock, > and it shall be opened to you. -- Matthew 7:7 > > Sorry, I couldn't resist. Here is a package with NO instantiations, > and a bounded array type that can handle different length strings. That isn't a direct replacement for Ada.Strings.Bounded, so I'm a little confused. It is also possible to write a direct replacement for Ada.Strings.Bounded that is not generic, but takes a discriminant for the max length. Ignoring that ... > I would like comments on the interface, and any other operations > that might make sense. (For example relational operations between > rows and Strings.) Well, I don't think I've ever needed a container of strings (which is one way to describe this thing). I've needed symbol tables and such, which contain strings, but also contain other things. > You had better believe that if this pattern is this hard to find, it > probably belongs in the standard, rather than in my back pocket. Hmm. If someone said to me "please write a container of strings, in Ada 83, with no dynamic memory allocation", this is probably what I would have come up with. Sorry to be so negative ... -- -- Stephe