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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9fb8e2af320d5b3e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Bus error Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp> <1l4yqvxoid4n1.1u8eo4oo8ml4m$.dlg@40tude.net> <4685280c$0$14869$9b4e6d93@newsspool4.arcor-online.net> <46865672$0$23136$9b4e6d93@newsspool1.arcor-online.net> <18um6sna5z89.1ksvtmbvj91ds$.dlg@40tude.net> <1b9ocrlv2jphe.3fmct1wz53o4$.dlg@40tude.net> Date: Sun, 1 Jul 2007 21:41:12 +0200 Message-ID: NNTP-Posting-Date: 01 Jul 2007 21:40:28 CEST NNTP-Posting-Host: 7329df14.newsspool1.arcor-online.net X-Trace: DXC=YgS15LIdnP=TQL:hoD@>T?ic==]BZ:af>4Fo<]lROoR1Fl8W>\BH3Y2jB;^`NDi2f1DNcfSJ;bb[5IRnRBaCd On Sun, 01 Jul 2007 11:39:33 -0400, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >>... Does "use" >> declare something? > > No. And it's not a declaration. So should be renaming, at least ideally, a pure name space thing. For LHS and implementation by renaming it would be better to have some delegation mechanism. >> If I designed rename, I would certainly allow X renames X; similarly to >> "use" or "with" A, A; > > OK, I think I see what you're getting at. You would then say that > referring to X is legal (not ambiguous) because both of those > declarations of the name X refer to the same entity. Right? > > To make this work, you need to distinguish static and dynamic. > > X : Integer renames Func(...).all.Component(Func2(...)); > X : Integer renames Func(...).all.Component(Func2(...)); Illegal, for they denote different objects. > X := X + 1; -- legal? > > I don't think you want a run-time check that the two > names X denote the same entity! Yes, of course. I would just match names. If the names match after resolving all renamings, then the objects considered same. When they don't match or do not resolve, then objects are considered different. This becomes interesting with literals and aggregates which are names of themselves. There exist a similar situation with matching signatures of subprogram's declaration and implementation when arguments have defaults. I forgot how it is solved there. > FWIW, I would simply delete the no-duplicate-homographs rule. > And weaken the overload resolution rules. Yes. However, there still would remain the issues of checking the subtype of the renamed thing and of proper renaming of types: type T is tagged private; procedure Foo (X : T); -- Primitive type S is private renames T; -- Hmm, is Foo primitive of S, would it dispatch? (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de