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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-13 12:00:14 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshub.sdsu.edu!logbridge.uoregon.edu!msunews!not-for-mail From: "Chad R. Meiners" Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" Date: Thu, 13 Nov 2003 14:59:09 -0500 Organization: Michigan State University Message-ID: References: for reply from news@kiuk0156.chembio.ntnu.no> <3FAF8C99.5040201@noplace.com> <3FB1609E.D56E315C@fakeaddress.nil> NNTP-Posting-Host: arctic.cse.msu.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:2459 Date: 2003-11-13T14:59:09-05:00 List-Id: ----- Original Message ----- From: "Russ" <18k11tm001@sneakemail.com> Newsgroups: comp.lang.ada Sent: Thursday, November 13, 2003 2:26 AM Subject: Re: Clause "with and use" > I say it's redundant because it doesn't make sense to have "use" > without a corresponding "with". Let's say "with" is level 1, and "use" > is level 2. If you're at level 2, that implies you're already past > level 1, so specifying both level 1 and level 2 is redundant. It's > like saying that the Florida Marlins won the World Series, then also > saying that they won the NL Championship. The former implies the > latter and is therefore redundant. It belongs in the Department of > Redundancy Department. Your analogy is bad. with Ada.Text_IO; -- I want to be able to reference Ada.Text_IO in this unit. use Ada.Text_IO; -- I want Ada.Text_IO's components to be placed into the current scoping block. (does it make sense to use a withed procedure?) > I appreciate your discipline in shunning "use," but I assume the > language provides it for a good reason. For basic I/O and math, for > example, I think "use" is perfectly appropriate. I'm sorry, but "sin" > and "cos" will always be just "sin" and "cos" to me, and I prefer to > see them that way. (I gave an example on this forum a few months ago > of great-circle equations involving no less than 10 math function > calls in a single expression.) Well you can always place the use clauses in the great-circle function then. > > I think the cleanest approach is to let "use" imply "with". What does > that mean? If the compiler sees "use x", but x is not yet "in scope", > let the compiler simply pretend that the line "use x" had been > preceded by "with x". So you would you want a use clause that is nested within a function to imply a withed package? In my opinion that is practically as bad as Java allowing you to reference any class from any point in your class. Both cases make it very difficult to find all the referenced packages. > Now, admittedly, that involves some semantic subtleties because the > "withed" package spec need be identical to the "used" spec (due to the > conventions for child packages). I suspect that any potential > ambiguity is easily resolvable with simple conventions, but I could be > wrong. OK, suppose I am wrong. Then the fallback position is to allow > "with and use x" or "with/use x", as previously suggested. That > removes all semantic ambiguity, and is logically equivalent to > separate "with" and "use" clauses, but without the repetitious > clutter. with's and use's for the most part belong in different regions of the code. Providing syntax to couple then together would be a determent to anyone learning the language. > For those who insist that this whole issue is "minor" or even > "trivial", here's what I have to say to you. You're all idiots and > dumbsh*ts. Relax, I'm just kidding. I wonder how often you call the people you work with idiots and dumbsh*ts to their face and then say, "Relax, I'm just kidding". As you might realize, they won't believe the second part; why should we believe you here. You have already shown that the only opinion and information that you value are those that support your ideas. Statements like the above just reinforce everyone's opinion that this is true. > You are completely right. It *is* > trivial. But as I said before, it's like the clutter in the front yard > of a house for sale: it can do harm to the market value of Ada, and > it's trivial to clean up too. For crying out loud, just do it and be > done with it. But it isn't clutter; with and use serve two different purposes so they shouldn't be combined.