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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: What do you think about this? Date: Mon, 6 Jul 2015 15:07:36 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com> <17436268-aceb-461f-bdcf-eee8436cd0e6@googlegroups.com> <86y4jaqzdx.fsf@stephe-leake.org> <86oak5qulb.fsf@stephe-leake.org> <86k2usq66p.fsf@stephe-leake.org> <864mllqv7c.fsf@stephe-leake.org> <864mli3e0k.fsf@stephe-leake.org> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1436213257 17991 24.196.82.226 (6 Jul 2015 20:07:37 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 6 Jul 2015 20:07:37 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:26658 Date: 2015-07-06T15:07:36-05:00 List-Id: "Stephen Leake" wrote in message news:864mli3e0k.fsf@stephe-leake.org... > "Randy Brukardt" writes: > >> "Stephen Leake" wrote in message >> news:864mllqv7c.fsf@stephe-leake.org... > >>> Using a bounded string always involves a hidden length limit; if it's >>> too small, you'll hit it sometime, if it's too big, you're wasting >>> storage. >> >> Agreed, but in that case he probably should be using an unbounded string. >> Let the compiler do the work, don't write memory management code yourself >> (you'll always get it wrong). > > The use case is declaring arrays of constant strings; no memory > management involved. There's *always* memory management involved (speaking from the perspective of a compiler author), especially as Ada doesn't support arrays of constant strings of different lengths. The memory that holds them comes from somewhere...and you don't want to be writing that code yourself. Randy.