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-11 12:01:11 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: 11 Nov 2003 12:01:11 -0800 Organization: http://groups.google.com Message-ID: References: <3FA2CDCB.500F4AF0@fakeaddress.nil> <3FACCBFB.9D288CF2@fakeaddress.nil> <3FAF8C99.5040201@noplace.com> <1068561335.260886@master.nyc.kbcfp.com> NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1068580871 29655 127.0.0.1 (11 Nov 2003 20:01:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 11 Nov 2003 20:01:11 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:2371 Date: 2003-11-11T12:01:11-08:00 List-Id: Preben Randhol wrote in message news:... > On 2003-11-11, Hyman Rosen wrote: > > Preben Randhol wrote: > >> But what is the point? What do you save by doing this? Absolutely > >> nothing. It took me 2 min to make two macros in vim which either add a > >> use unit or removes it. > > > > That's *not* the point. As is so often said around here, > > Ada doesn't care about the convenience of the writer of > > the code. Perhaps if you had written macros to tell the > > reader of the code which withed packages were also used, > > you would have demonstrated something useful. > > You misunderstood. > > In my code I write: > > with Ada.Text_IO; \au > > The \au which is my shortcut (it could have been Ctrl-J or F4 etc... > depending on preference) will then make this line look like: > > with Ada.Text_IO; use Ada.Text_IO; > > and I can continue typing. > > It will work with any withed package as it simply copies what comes > after with until the ;. A shortcut \aU removes the use Package; from a > line. > > There is no preprosessors involded. As I have said: the convenience of > the writer is the responsibility of the text editor (in my case vim) not > Ada. > > As to telling the reader which packages are used, the source code will > say so and you cannot manage to make it much clearer IMHO. And you *still* miss the point, even after Mr. Rosen spoonfeeds it to you. The point is *not* that redundant "with" and "use" clauses require extra typing. The point is that the poor *reader* of your code still has to *read* your cluttered code. In your reply you did not even consider the *reader*. The *reader* doesn't give a hoot how many keystrokes you used to generate the code. All I can say is that I'm darn glad I'll never have to read your code.