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-7-bit X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Use use type? (Was Re: Safety-critical development in Ada and Eiffel) Date: 1997/08/01 Message-ID: #1/1 X-Deja-AN: 261337272 References: <5r64cq$meh@peg.apc.org> <5rrr5a$dds$2@peuplier.wanadoo.fr> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-08-01T00:00:00+00:00 List-Id: In article <5rrr5a$dds$2@peuplier.wanadoo.fr>, J-P. Rosen wrote: >I do not agree. When I go walking, I take some food WITH me. I open the box >when I want to USE it. > >The whole idea of the use clause is that often, you don't need a withed >package everywhere. If I write -say- a complex number package with a Put >function, I have to with Text_IO; however I use it only in the Put ^^^^^^^^^^^^^^^^^^^^^^ >function. The use clause is intended to do just that: open visibility only >in places where the package is really used. Perhaps you mean, "I have to take Text_IO WITH me." ;-) At least that's syntactically correct English, unlike "I have to with Text_IO". (Either way, I don't mind anthropomorphizing the code.) To me, "Package Complex_Numbers uses Text_IO" and "Package Complex_Numbers uses Text_IO only within its Put procedure" and "Procedure Complex_Numbers.Put uses Text_IO" all make sense in plain English, and do not necessarily imply a use_clause. I mean, one way to use Text_IO is to say "Text_IO.Put(...)". >THIS means that in general, it is a bad idea to put the use clause on top >of the pakage, except if you really use the package everywhere. >Unfortunately, this was the case for every example in RM83, and people >tended to do it systematically, and then complained that things got visible >even when not used... > >For more details, refer to "In defense of the USE clause" in Ada letters, >Nov. 87. > >This note is NOT intended to restart the old debate about the use clause >;-) Hmm. *I* was just complaining about the reserved word used. *You're* the one who inserted the above arguments about if/when it's good to use these features. - Bob