comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: Why both "with" and "use"?
Date: 1999/02/18
Date: 1999-02-18T00:00:00+00:00	[thread overview]
Message-ID: <7ah3te$g6p$1@platane.wanadoo.fr> (raw)
In-Reply-To: 7afue4$8ed$1@nnrp1.dejanews.com


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" <rosen.adalog@wanadoo.fr> 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






  reply	other threads:[~1999-02-18  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-13  0:00 Why both "with" and "use"? Mike Silva
1999-02-13  0:00 ` Pat Rogers
1999-02-13  0:00   ` bill
1999-02-13  0:00     ` Pat Rogers
1999-02-13  0:00       ` Matthew Heaney
1999-02-13  0:00         ` bill
1999-02-14  0:00         ` Pat Rogers
1999-02-14  0:00           ` Bob Collins
1999-02-14  0:00             ` Pat Rogers
1999-02-16  0:00         ` Samuel Mize
1999-02-13  0:00     ` Matthew Heaney
1999-02-15  0:00     ` Jean-Pierre Rosen
1999-02-15  0:00       ` Ed Falis
1999-02-16  0:00         ` Jean-Pierre Rosen
1999-02-13  0:00 ` Corey Minyard
1999-02-13  0:00   ` mike
1999-02-13  0:00   ` Matthew Heaney
1999-02-13  0:00     ` bill
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` Matthew Heaney
1999-02-13  0:00     ` Tom Moran
1999-02-14  0:00       ` Matthew Heaney
1999-02-16  0:00     ` Samuel Mize
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-17  0:00       ` dennison
1999-02-17  0:00         ` Nick Roberts
1999-02-17  0:00         ` Samuel Mize
1999-02-17  0:00       ` Matthew Heaney
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-18  0:00         ` dennison
1999-02-18  0:00           ` robert_dewar
1999-02-19  0:00             ` Robert I. Eachus
1999-02-19  0:00               ` robert_dewar
1999-02-23  0:00                 ` Robert I. Eachus
1999-02-19  0:00               ` Brian Hanson
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00             ` dennison
1999-02-19  0:00             ` bourguet
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00           ` Matthew Heaney
1999-02-19  0:00             ` dennison
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00                 ` dennison
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                 ` Ada multiple string personalities. why so many? mike
1999-02-19  0:00                   ` Tom Moran
1999-02-19  0:00                     ` Mike Silva
1999-02-22  0:00                       ` Brian Hanson
1999-02-19  0:00                   ` robert_dewar
1999-02-18  0:00         ` Why both "with" and "use"? robert_dewar
1999-02-18  0:00           ` Jean-Pierre Rosen [this message]
1999-02-18  0:00             ` robert_dewar
1999-02-19  0:00               ` Jean-Pierre Rosen
1999-02-15  0:00 ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox