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,8c424d8135e68278 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-20 06:17:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) Newsgroups: comp.lang.ada Subject: Re: Ada2005 Date: Thu, 20 Dec 2001 14:17:48 GMT Message-ID: <3c21f040.107722343@News.CIS.DFN.DE> References: <9v4jsj$bd1$1@infosun2.rus.uni-stuttgart.de> <9v7f26$qn2$1@infosun2.rus.uni-stuttgart.de> <3C1754BA.C4560423@informatik.uni-jena.de> <3c1868b2.1587625@News.CIS.DFN.DE> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) X-Trace: fu-berlin.de 1008857869 18101770 212.79.194.111 (16 [77047]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:18144 Date: 2001-12-20T14:17:48+00:00 List-Id: On Wed, 19 Dec 2001 18:20:41 GMT, "Mark Lundquist" wrote: > >"Ray Blaak" wrote in message >news:uvgf5rb15.fsf@telus.net... >> dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) writes: >> > However, what people criticizing Ada usualy want, is just a syntax >> > sugar, which would allow to refer methods using postfix form if there >> > is only one dispatching [or class-wide] argument and it is the first >> > one. >> >> Like me. >> >> > I think in a future revision there could be some variant of rename >> > statement which would allow to do this and also the opposite thing >> > [for "methods" of protected objects and tasks which are always called >> > using the postfix form]. For instance: >> > >> > type Ellipse is tagged ... >> > procedure Draw (Figure : Ellipse, Where : Point); >> > entry Ellipse.Draw (Where : Point) renames Draw; >> >> Why not make it automatic? The extra declaration is tedious and requires >extra >> maintenance. >> >> Given: >> >> e : Ellipse; >> >> then have >> >> e.Draw(p) >> >> be valid iff Draw exists with an Ellipse as its first parameter. >> >> Then it is truly just an alternate syntax to be used if desired, and not >used >> if not. >> > >Doesn't it make a mishmash of the name resolution rules? Consider > > type Note is private; > > function Pitch (Subject : Note) return Note_Properties.Pitch; > function Length (Subject : Note) return Note_Properties.Length; > > private > > type Note is record > Pitch : Note_Properties.Pitch; > Length : Note_Properties.Lenght; > end record; > >In the body of the package, how do you resolve the name "X.Pitch" for an X >of type Note? We already have this case with protected types: protected type X is function Y return Integer; private Y : Integer; -- Illegal! end X; Thus the compiler should complain about: Pitch : Note_Properties.Pitch; Regards, Dmitry Kazakov