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,1e3f2eac5c026e3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-19 15:18:17 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newshub.northeast.verio.net!verio!newsfeed.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Other Ada Standards (was Re: SIGada Conference) Date: 19 Dec 2003 18:18:17 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <468D78E4EE5C6A4093A4C00F29DF513D04B82B08@VS2.hdi.tvcabo> <657ea3e3.0312172255.4869eae5@posting.google.com> <0cOdndZsZbH6W3yiRVn-gg@comcast.com> NNTP-Posting-Host: pip1-5.std.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1071875897 20283 192.74.137.185 (19 Dec 2003 23:18:17 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 19 Dec 2003 23:18:17 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:3591 Date: 2003-12-19T18:18:17-05:00 List-Id: 18k11tm001@sneakemail.com (Russ) writes: > Robert A Duff wrote in message news:... > > "Robert I. Eachus" writes: > > > > > As for "with and use" I did comment on that proposal here. Unfortunately > > > I probably spent more time explaining why "use implies with" can't work, > > > than discussing how to allow a "with and use" context clause. The > > > problem with "with implies use" has nothing to do with most cases where > > > users would want to use "with and use". The problem is that some use > > > clauses, even in context clauses, name units that cannot be withed. > > > Adding "with and use" to the language would not be a problem, changing > > > "use" to mean "with and use" is a non-starter. > > > > I don't agree. You could say that "use A.B.C;" in a context clause > > implies a subset of "with A;", "with A.B;", and "with A.B.C;" -- just > > the ones that happen to be library units. Or, you could *require* that > > they be library units, or be nested within already-mentioned library > > units, if you think that makes the code more readable. Either rule > > would work, and be easily implementable. > > And either rule would be preferable to requiring double naming of the > library units. I agree. > > Unfortunately, you can't just say that "use A.B.C;" is equivalent to > > "with A.B.C; use A.B.C;", because A.B.C might not be a library unit. > > Suppose A.B is a library package containing a nested package C. > > Then "with A.B; use A.B.C;" is currently legal. We can't say it's > > equivalent to "with A.B; with A.B.C; use A.B.C;", because that would > > be illegal, so the rule would be incompatible. > > And here's yet a third alternative that would be preferable to the > double naming clutter at the top of so many source files. Simple let > "use" imply "with", and if it doesn't compile, so what? The programmer > simply goes back and put in an explicit "with" that makes it work. No > big deal -- and no worse than the current situation. I've no idea what you mean here. What I was trying to say in the paragraph you quoted above is: If A.B is a library package, and contains a nested package C, then "with A.B; use A.B.C;" is currently legal. If "use" implies "with", then that means "with A.B; with A.B.C; use A.B.C;", which is illegal (and should remain illegal -- you can only "with" library units). There's no with_clause you can add to make it legal. > So there are at least three alternatives that are preferable to the > status quo. If all three of them are rejected, then I think the Ada > community is shooting itself in the foot -- or somewhere else. As usual, Russ, you way overestimate the importance of such syntactic sugar. I agree with you that some such more-concise syntax would be an improvement, and I disagree with those who say the sky would fall if we allowed it. But there are far more important changes (like allowing initialization of limited objects), and *every* change has some cost. - Bob