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,b6e97963d32ee242 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-28 17:55:39 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: aek@vib.usr.pu.ru (Alexander Kopilovitch) Newsgroups: comp.lang.ada Subject: Re: The old "Object.Method" syntax debate Date: 28 May 2003 17:55:39 -0700 Organization: http://groups.google.com/ Message-ID: References: <254c16a.0305210726.485125de@posting.google.com> <3eccdf77$1@epflnews.epfl.ch> <3ecdd296$1@epflnews.epfl.ch> <3ED056CB.8000200@attbi.com> <3ed46d7a.994560@news.btclick.com> NNTP-Posting-Host: 62.152.82.100 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054169739 10295 127.0.0.1 (29 May 2003 00:55:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 29 May 2003 00:55:39 GMT Xref: archiver1.google.com comp.lang.ada:37961 Date: 2003-05-29T00:55:39+00:00 List-Id: >>The name space for attributes is too important language resource, it should >>not be given out freely for general use. >> How about another character instead of apostrophe (or dot) for user-defined >>attributes? For example, there is quite popular # (read "join" for this purpose): >> Object#Operation >>("controlling object" somehow associates with "base" -:) > >Nah - that's ugly :-) Well, perhaps Microsoft wouldn't say so -:) Anyway, I just imagined another notation for that purpose, and it seems worth of discussion: dot-qualified attribute Method, i.e. Object'Method.Operation for example: type T is ... ; function F(P : T; Q : Integer) return Integer; X : T; Actual_Q : Integer; ... X'Method.F(Actual_Q); For me, this notation looks quite straight. Indeed, one may think that the attribute Method returns a record -- method table, like in C++ code. (If you will argue that the attribute part in this notation is obviously redundant, I will reply that you English all the time use articles "a" and "the", which seem no less redundant for Russian native speaker, like me -:) . Furthemore, with this approach we may easily provide a denotation for the corresponding abstraction, that is, unified notation for a component and a method; all we need for this is another attribute Property, which should be used the same way: for both type T is ... ; function F(P : T) return Integer; and type T is record F : Integer; ... end record; we can write: X : T; R : Integer; ... R := X'Property.F; (This approach does not provide assignment to a property; for writable properties we can rely upon controlled data components.) Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia