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-14 15:23: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: 14 Nov 2003 15:23:39 -0800 Organization: http://groups.google.com Message-ID: References: for reply from news@kiuk0156.chembio.ntnu.no> <3FB1609E.D56E315C@fakeaddress.nil> NNTP-Posting-Host: 128.102.146.44 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1068852219 14548 127.0.0.1 (14 Nov 2003 23:23:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 14 Nov 2003 23:23:39 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:2507 Date: 2003-11-14T15:23:39-08:00 List-Id: "Chad R. Meiners" wrote in message news:... > "Russ" <18k11tm001@sneakemail.com> wrote in message > news:bebbba07.0311132145.58a4541e@posting.google.com... > > 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. > > Sure there is. In most cases it improves code readability by reminding the > reader about which packages are being used. > > > As far as I'm concerned, that's obsessive/compulsive. > > It is not obsessive/compulsive; it is putting the information where it > should be as opposed to doing what is convenient. I have always found > comments about obsessive/compulsiveness interesting as that are almost > always use as an insult towards people that display an usual amount of > discipline in an activity. My "favorite situation" is when people make > obsessive/compulsive comments about safety procedures (He/she is > obsessive/compulsive about wearing safety goggles when working with that > wood lathe). Strangle enough, your comment sort of falls into that > category. Code readability is a safety issue. Yes, but if you wear safety goggles when you watch TV (because you never know when your TV tube might explode), that is obsessive/compulsive. I can make up irrelevant examples as well as you can. By the way, mild obsessive/compulsive disorder is very common and is not necessarily a major character flaw. I suffer from a bit of it myself. > > > > 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. > > Which would imply that use clauses would have very different semantics based > upon the scope in which they are placed. That would really help people > misunderstand the language's semantics. Nonsense. In Python, I can write "import math", which is equivalent to Ada's "with", or I can write "from math import *", which is equivalent to "use". And if I use the latter, I don't need to precede it by the former. Yet nobody misunderstands anything. This whole line about "with" and "use" having different meanings is completely irrelevant. I don't care if "with" sends a mouse to the moon and "use" massages my feet. The simple fact is that "use" implies "with," whether you like it or not. Just try to use "use" without "with", and the compiler will tell you so. If I say, "use a hammer," do I need to precede it with, "obtain a hammer"? Of course not. You cannot possibly "use" a hammer if one is not available. You are confusing two different issues here. One issue is what *you* consider good programming practice, and the other issue is what the language allows or should allow. *You* don't think that "use" should ever be used in the context section at the top of a file. Sorry, Ada allows it, and many excellent programmers consider it perfectly acceptable in many cases. But since you don't like that particular feature, you want to keep it as inconvenient as possible to use. Well, isn't that just a bit self-centered? I and others would like to be able to use this officially blessed language feature, but we don't want to have to jump through unnecessary hoops to use it. Neglecting to floss your teeth is bad practice. Maybe hotels should not let you check in unless you show them that you are carrying dental floss. What harm could it do? I'll tell you what harm it could do. It could drive away clients, even ones who carry dental floss, because people don't like to be micro-managed. > When you speak in public, you are expected to remain civil. To do > otherwise is simply a negative statement about your character, but I will > let you worry about your public image. Where were you when I was called an "idiot" and a "dumbass" without provocation, right here on this forum? I could have used your wisdom then.