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!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: gettext for Ada Date: Tue, 28 Nov 2017 16:41:04 -0600 Organization: JSA Research & Innovation Message-ID: References: <2c5d0dff-bc12-4b37-b8e1-ac176c3e675f@googlegroups.com> <40dc6a79-9434-4b5a-bed0-50ee1dfb74c5@googlegroups.com> Injection-Date: Tue, 28 Nov 2017 22:41:05 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="8113"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:49227 Date: 2017-11-28T16:41:04-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:ovk4ss$b9u$1@gioia.aioe.org... > On 2017-11-28 01:48, Randy Brukardt wrote: > >> The above is quite common in my code (perhap premature optimation on my >> part, knowing that a function like To_Upper is many times more expensive >> than a string compare). > > I convert the source line to the preferred case as I read it in and then > work with that source. The is my preference, but there a lot of cases (like command line processing) where some parts are in mixed case (which you need to preserve) and other parts are case insensitive. Then you get the sort of code I showed, because individually converting slices is expensive and usually unnecessary (options usually are one or two characters in Janus/Ada programs). Randy.