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!aioe.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Strings with discriminated records Date: Wed, 30 May 2018 07:00:48 +0200 Organization: Adalog Message-ID: References: <55ce14eb-6b83-4ea0-a550-f9e1410d0b06@googlegroups.com> <51dfb377-1b3e-45ca-a211-158101efe557@googlegroups.com> <090d6eb2-9f52-4471-a22e-ce1bdf457188@googlegroups.com> <90f0f8da-dadd-4341-bc0f-dbda94b0516c@googlegroups.com> <137bcc76-2489-4557-979b-5efeecbd9289@googlegroups.com> <02ca60ab-0cf6-45d6-bed5-0358d4f5763d@googlegroups.com> NNTP-Posting-Host: XdjV4tYMtFfMKGpv0MuDzQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Content-Language: fr Openpgp: preference=signencrypt X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:52775 Date: 2018-05-30T07:00:48+02:00 List-Id: Le 30/05/2018 à 00:41, Randy Brukardt a écrit : > "Dmitry A. Kazakov" wrote in message > news:pejmlh$1ic1$1@gioia.aioe.org... > ... >> The case is represented by this: >> >> use Ada.IO_Exceptions; >> use Streams.Stream_IO; >> >> begin >> ... >> exception >> when End_Error => -- Illegal >> null; >> end; >> >> which is obviously wrong, the code must be OK. >(Of course, > the real problem above is "package use clauses", don't use (ahem) them and > you can't possibly have this problem.) > ???? With use clauses, you'll have to write: when Ada.IO_Exceptions.End_Error => while without use clauses, you'll have to write: when Ada.IO_Exceptions.End_Error => I fail to see the "real problem". Use clauses make the code more readable, and when there is an ambiguity, you fall back to what you would do without them. What's the problem? -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr