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!feeder.eternal-september.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: gnat.string_split , howto manipulate slice numbers Date: Tue, 29 Oct 2019 21:36:01 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net bGFjEYHyoZCbNON0Jpnr2QmJ3N89wPURN8nIwRO+Pf/Kx8SJl+ Cancel-Lock: sha1:ALVHT1YdEP9J0ujaWzJ/GNx3cDs= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57379 Date: 2019-10-29T21:36:01+02:00 List-Id: On 2019-10-29 18:56, Jeffrey R. Carter wrote: > On 10/29/19 9:17 AM, briot.emmanuel@gmail.com wrote: >> >>      use type GNAT.String_Split.Slice_Number; >> >> or >>      use GNAT.String_Split; > > or > > function "-" (Left  : GNAT.String_Split.Slice_Number; >               Right : GNAT.String_Split.Slice_Number) > return GNAT.String_Split.Slice_Number renames GNAT.String_Split."-"; Yes, but I do not recommend this "rename" method for wide use. Some decades ago, in an Ada 83 project which thus did not allow "use type", we had several bugs where copy-paste sloppiness resulted in (for example) some "-" operator renaming a "+" operator, with "amusing" results. I believe the risk of such bugs was a major reason for the introduction of "use type" in Ada. -- Niklas Holsti niklas holsti tidorum fi . @ .