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=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3cd94a799504cebd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-17 07:22:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed1.uncensored-news.com!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <19130ae.0110151428.65937d5b@posting.google.com> <3BCC8AF0.A8B1115D@san.rr.com> <9qi8ls$a2g1@news.cis.okstate.edu> Subject: Re: Small question concerning use Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Wed, 17 Oct 2001 10:21:41 EDT Organization: http://www.newsranger.com Date: Wed, 17 Oct 2001 14:21:41 GMT Xref: archiver1.google.com comp.lang.ada:14806 Date: 2001-10-17T14:21:41+00:00 List-Id: In article <9qi8ls$a2g1@news.cis.okstate.edu>, David Starner says... > >On Tue, 16 Oct 2001 20:26:16 GMT, Ted Dennison wrote: >> The best thing to do here is to take it as a constant reminder to yourself to >> pick better names for your *own* packages and objects. > >The problem is, how? Ada.Streams.Count is un"use"able; it would conflict >with other variables named Count (besides being just a bad name all First off, it probably wouldn't be "Count", but rather "Element_Count" (we are just talking about removing the redundant information here). Secondly, it is quite usable. The only problem is that, in the event of a clash, you can't get at it when its enclosing package has been used, as the multiple definitions hide each other. In this case, that's fine, as you can just specify enough extra information to disambiguate it in this case. Your use still works fine for all the other stuff in that package. So in the event of a name clash, this would read "Streams.Element_Count" in a "use"er's code, which differs from the current version a "use" user has to type by all of two characters. One of those characters is a "." instead of a "_". The "." version gives the reader more information about the object, so its clearly the better version. I think we should all be able to agree that its just plain silly to try to fight against "use"ers removing package information from their code (which is exactly what someone *wants* to do when they use a "use" clause) by manually duplicating that package information in the name of every entity in the package. >around). How do you name a variable so it doesn't conflict with other >names when "use"d, but doesn't do too much repetition. What should You can't, of course. That's one of the dangers you run every time you perform a "use". You rolls your dice, you takes your chances. Its not a fatal problem. If you were willing to type that disambiguating information when it was part of the object's name, what's the problem with typing it when it is its enclosing package's real name? It's just a "." vs. an "_". --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.