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,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-08 07:49:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? Date: Wed, 08 Oct 2003 16:58:56 +0200 Message-ID: References: <3F7B1076.8060106@comcast.net> <5mknnv4u96qqudrt4bd8n4t1cljp2fjlp8@4ax.com> <3F7C810E.7070100@comcast.net> <3F7E25C1.1060509@comcast.net> <3F7ECF99.8090004@comcast.net> <8qm2ov43djse19is7pk79jf5p7ifvvuff2@4ax.com> <3F841C3D.30007@comcast.net> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1065624572 18206839 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:464 Date: 2003-10-08T16:58:56+02:00 List-Id: On Wed, 08 Oct 2003 14:16:53 GMT, "Robert I. Eachus" wrote: >Dmitry A. Kazakov wrote: > >> What if 31 character length string is required? Now we have answered >> the question, why Bounded_String was made generic - to avoid arbitrary >> limitations like the number 30 in the example. > >I may be misunderstanding you. Yes >If you may be faced with a 31 character >string (or any arbitrary length) then you should be using >Unbounded_String. Come on! In 80% cases when I do not know the exact length I am not forced either to turn to generics or to heap-allocated objects. Conventional String works fine: Buffer : String (1..Whatsoever); Why should I use Unbounded_String? If this works with singular objects and with records of objects why on earth it should not with arrays? The point is: A clear deficiency is an inability to constrain [*all*] the array elements through a discriminant. This in turn makes a non-generic implementation of Bounded_String less usable. An example of use: type Array_Of_Bounded_Strings (Max_Length : Natural) is array (...) of Bounded_String (Max_Length); Where is any limit here? --- Regards, Dmitry Kazakov www.dmitry-kazakov.de