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-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.125.233 with SMTP id mt9mr13790855pbb.5.1335706531469; Sun, 29 Apr 2012 06:35:31 -0700 (PDT) Path: r9ni112145pbh.0!nntp.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Sun, 29 Apr 2012 09:35:30 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <1qepvaumldb5u.1q8eyzla8dyp8.dlg@40tude.net> <14f21yy6r7n40.v7wdf6rhdgjz.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1335706531 807 192.74.137.71 (29 Apr 2012 13:35:31 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 29 Apr 2012 13:35:31 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:LBkH8ETl/SS47KtxvZ/9nGqKdZ4= Content-Type: text/plain; charset=us-ascii Date: 2012-04-29T09:35:30-04:00 List-Id: "Dmitry A. Kazakov" writes: > On Fri, 27 Apr 2012 09:56:36 -0400, Robert A Duff wrote: >> In my language, every named thing must have a unique name. >> It can also have an overloaded name. > > Is the name space same? Yes. >...One could have a separate name space for unique > names. I'm not sure what you mean. Usually "separate name space" implies distinguishing which name space you're referring to via some syntactic means. For example, Ada could have a separate namespace for labels, because they can only appear after "goto" and inside <<...>>. Oops, I forgot about Label'Address. Nix that. > So the imaginary setup is: > > 1. X and inner X are unambiguous: not Clash (X, inner X) > 2. X hides outer X: Clash (X, outer X) > 3. outer X and inner X are ambiguous: Clash (outer X, inner X) I'm not sure what you mean. I'm suggesting (and, I think, Randy was) a rule where everything is overloadable, and if you have two things called X, neither hides the other. This is the way use-visibility work in Ada, but only for subprograms. Single namespace. The name resolution rules would need to be completely rewritten, but the basic idea is that if you can't tell which X it is (based on those rules), it's ambiguous and therefore illegal. There's no need to prevent clashes. If you say: X: constant Integer := 123; X: constant Integer := 456; (both in the same scope) then all references to X would be ambiguous. So don't do that. These rules would not be compatible, therefore they won't happen, and I'm not seriously proposing them. > This looks broken already. Ambiguity must be transitive: > > Clash (X, outer X) and Clash (outer X, inner X) => Clash (X, inner X) I agree that ambiguity should be transitive, and never meant to suggest otherwise. That is, if you swap inner X and outer X, it wouldn't change the ambiguity of complete contexts that have visibility on both. > If not transitive, that must be fixed even if backward incompatible. Well, we know you don't care very much about compatibility, but I assure you ARG would be tarred and feathered if we threw compatibility concerns out the window. And rightly so. The Ada 9X team and the ARG already get grumbling about the fairly modest incompatibilities that were introduced. There are all sorts of improvements that could be made to Ada (or any other language) if we didn't care about compatibility. But the end result would be a different language, and should therefore have a different name. >> Hiding is evil. > > Yes, sometimes handy. My pet idea is that instead of hiding the language > should require to rename the offending outer entities. I should have said "Implicit hiding is evil." Or "Accidental hiding is evil." I wouldn't mind having a feature like "hide X, Y, Z;", which explicitly makes everything with those names vanish. But anyway we're not going to get rid of implicit hiding in Ada -- way too incompatible. - Bob