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 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 07:04:11 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" Date: Tue, 11 Nov 2003 15:04:11 +0000 (UTC) Organization: PVV Message-ID: References: <3FA2CDCB.500F4AF0@fakeaddress.nil> <1068123815.335508@master.nyc.kbcfp.com> <3FAAB12E.C7593B45@fakeaddress.nil> <3FACCBFB.9D288CF2@fakeaddress.nil> <3FAF8C99.5040201@noplace.com> <1068561335.260886@master.nyc.kbcfp.com> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1068563051 23702 129.241.83.82 (11 Nov 2003 15:04:11 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Tue, 11 Nov 2003 15:04:11 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:2349 Date: 2003-11-11T15:04:11+00:00 List-Id: 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. -- "Saving keystrokes is the job of the text editor, not the programming language."