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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-31 13:02:05 PST Message-ID: <3FA2CDCB.500F4AF0@fakeaddress.nil> Date: Fri, 31 Oct 2003 22:02:03 +0100 From: Gautier Write-only X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Clause "with and use" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 80.218.90.97 X-Trace: news.swissonline.ch 1067634124 80.218.90.97 (31 Oct 2003 22:02:04 +0200) X-Complaints-To: abuse@swissonline.ch Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.mailgate.org!news-zh.switch.ch!switch.ch!news.swissonline.ch!not-for-mail Xref: archiver1.google.com comp.lang.ada:1877 Date: 2003-10-31T22:02:03+01:00 List-Id: Peter Hermann's post about number_base reminds me on a suggestion of mine about a "with and use" clause in AC ! Comments are welcome... Original proposal follows: ____ Proposal for a "with and use" clause Hello! Almost the only thing I find tedious in Ada is the obligation to name twice packages you intend to _use_ in a context_clause. I illustrate with examples two usual ways of organizing context clauses: (A) -- (1) With'ed only with Ada.Command_Line; -- (2) With'ed and Use'd with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO; use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO; Problem: in practice the list pair (2) is a lot longer (many many lines) and becomes difficult to synchronize. It is also difficult then to _verify_ that the pair is consistent (B) -- (1) With'ed only with Ada.Command_Line; -- (2) With'ed and Use'd with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Float_Text_IO; use Ada.Float_Text_IO; Advantage: much easier to verify and transport across sources Problem: the beginning of sources becomes awfully long. To sum up, I'd describe the current situation so - beginner-repellent and newcomer-repellent (not to be neglected !) - ugly - redundant - causes a readability problem and possible confusions - pushes the real thing, i.e. the programming contents after "procedure/package... is", too far away of the source's top - needs too much administration My proposal: a "with and use" clause. "with and use A[,B]" would mean "with A[,B]; use A[,B]". (C) -- (1) With'ed only with Ada.Command_Line; -- (2) With'ed and Use'd with and use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO; ________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!