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: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.ecp.fr!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: Fri, 3 Jul 2015 12:35:05 -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> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1435944906 13074 24.196.82.226 (3 Jul 2015 17:35:06 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 3 Jul 2015 17:35:06 +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: number.nntp.giganews.com comp.lang.ada:193890 Date: 2015-07-03T12:35:05-05:00 List-Id: "Stephen Leake" wrote in message news:864mllqv7c.fsf@stephe-leake.org... > "Randy Brukardt" writes: > >> "Jeffrey R. Carter" wrote in message >> news:mmhd5h$qef$1@dont-email.me... >>> On 06/25/2015 06:16 AM, Stephen Leake wrote: >>>> "Jeffrey R. Carter" writes: >>>> >>>>> This is a terrible idea. As compiler writer, ARG member, and ARM >>>>> editor >>>>> Brukardt >>>>> said recently in another thread, anonymous access types are evil. >>>> >>>> This is one place they are very useful. >>> >>> Still evil and to be avoided, even here. >>> >>>>> I would even >>>>> argue against a named access type for this, since unbounded strings >>>>> are >>>>> available. In this case, the OP has an instance of bounded strings >>>>> available and >>>>> would probably want to use that. >>>> >>>> That makes them non-constant, which is certainly _not_ the intent! >>> >>> Declaring the array constant deals with that. >> >> Exactly. Why make things more complex than necessary? There's a place for >> the access-to-constant solution (although I'd use a named type), but it >> isn't here since the OP is using an bounded string type for all of his >> strings. > > He should not be using a bounded string type; that's the point. > > 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). Randy.