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 21:45:40 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" Date: 13 Nov 2003 21:45:39 -0800 Organization: http://groups.google.com Message-ID: References: <3FB1609E.D56E315C@fakeaddress.nil> NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1068788740 7064 127.0.0.1 (14 Nov 2003 05:45:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 14 Nov 2003 05:45:40 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:2472 Date: 2003-11-13T21:45:39-08:00 List-Id: "Chad R. Meiners" wrote in message news:... > ----- 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 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. Yes, but I don't want to repeat it in every function or procedure that needs it. And there is no good reason to limit Ada.Text_IO to individual functions and procedures. As far as I'm concerned, that's obsessive/compulsive. > > 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? No, absolutely not. The implied "with" would apply only to "use" clauses in the context section at the top of the file. You need something at the top of the file to let the reader (and the compiler) know what external packages will be used. > 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. I agree. > > 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. > > 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, No, I don't. But then again, I didn't say *anything* to anyone's "face" here, did I. Not to mention the fact that nobody here has the power to terminate my employment. By the way, have you been keeping track of what *I* have been called here? I get a lot more respect at work than I get here. > 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. Lighten up, dude. It was a little joke based on some recent posts on this thread and others. > > 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. So what that they serve two different purposes? Ever heard of "killing two birds with one stone"? Repeating the same package name twice at the top of a file is clutter. Even if the proposal is adopted, you would still be fully able to use "use" in the way you consider appropriate and/or correct. Nobody is trying to take anything away from anyone here.