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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,6cb2525ffbfe23ce X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Why both "with" and "use"? Date: 1999/02/18 Message-ID: <7ah3te$g6p$1@platane.wanadoo.fr>#1/1 X-Deja-AN: 445683440 Content-Transfer-Encoding: 8bit References: <36C5B28C.F32C43A4@jps.net> <7acj53$1vu@news3.newsguy.com> <7af68r$52o$1@platane.wanadoo.fr> <7afue4$8ed$1@nnrp1.dejanews.com> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 Organization: Adalog Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-18T00:00:00+00:00 List-Id: robert_dewar@my-dejanews.com a �crit dans le message <7afue4$8ed$1@nnrp1.dejanews.com>... >In article <7af68r$52o$1@platane.wanadoo.fr>, > "Jean-Pierre Rosen" wrote: >> My personal religion is to apply the use to the smallest >> region where it is necessary. > >I very much dislike this style, I think this kind of very >local use obfuscates the code, especially if you go so far >as to create blocks just for the purpose of including a use >clause. I would hate to see > > declare > use Text_IO; > begin > Put (A); > Put (B); > Put_Line (C); > end; > >I don't see that as helpful. Of course, this is an abuse and common sense applies. My example was rather: exception when Occur : others => declare use Ada.Exceptions; begin Put_Line ("Oops" & Exception_Name (Occur)); Raise_Exception (My_Exception'Identity, Message => Exception_Message (Occur)); end; Here, I wouldn't like a use clause applying to the whole subprogram when I really need it only in the exception part. >This does not mean of course that local use is always a bad >idea, but I am suspicious of any "religeon" in this area. >Better to have a completely non-religeous viewpoint, and >use whatever makes best sense in each particular situation. OK, I should have put a IMHO instead - some people are so religious about religions :-) --------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://perso.wanadoo.fr/adalog