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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b6e97963d32ee242 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-23 01:31:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-039-187.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: The old "Object.Method" syntax debate Date: Fri, 23 May 2003 10:34:16 +0200 Organization: At home Message-ID: References: <254c16a.0305210726.485125de@posting.google.com> <3eccdf77$1@epflnews.epfl.ch> <3ecdd296$1@epflnews.epfl.ch> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-039-187.arcor-ip.net (145.254.39.187) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1053678716 803959 145.254.39.187 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:37674 Date: 2003-05-23T10:34:16+02:00 List-Id: Rodrigo Garcia wrote: > "David C. Hoos" wrote in message > news:vcprq15q8m344e@corp.supernews.com... >> I dod not mean to suggest that the availability of "IntelliSense" > justified >> the >> new syntax. The new syntax would eliminate some code redundancy, as >> the AI points out. > > I agree that is the point of the AI. > >> > I am one of those who suspect that the new syntax would add more > confusion >> > than advantages to the language. >> As I pointed out in an earlier post, this syntax exists in Ada already >> for >> protected types. See, for example line 54 of phil.adb of the dining >> philosophers >> demonstration program that comes with GNAT: >> >> Room.Sticks (First_Grab).Pick_Up; >> >> Room.Sticks (First_Grab) is the object; Pick_Up is the operation. > > Well, I heard that protected types syntax was also subject of strong > discussions and I can understand why. Maybe because it is ugly? (:-)) Anyway prefix syntax exists also in the form of attributes. Strangely enough, that nobody has yet proposed to replace X'Length with X.Length. It would so OO-O-Oh! (:-)) > Nevertheless, protected types are > declared in a different way than tagged types. They already encapsulate > their subprograms and entries in their definition. Their syntax is more > similar to that used for declaring classes in mainstream OO languages so I > see natural to use the Object.Operation notation with protected types. > Even in your example you have the name of the package (Room), so they do > not "hide" the use clause. > > However, primitive operation declarations of tagged types are encapsulated > in the package as with any other kind of type and the syntax is inherently > different. Why should we be able to use the new syntax only with tagged > types? > > Hmm... Maybe it should be the other way round and keep the tagged type > syntax for protected types. I should propose "protected records" whose > primitive operations were run in mutual exclusion... what to do with > entries > then? :^) Entries are just subprograms with queues. If an entry has several protected arguments then a call to it should start a protected action on both. As for implementation, it should be no problem in case single processor - single lock. For multiple processors, I do not know, anyway it will be never accepted. (:-)) Same for task entries. They also (unfortunately) have prefix syntax which prevents potentially interesting one-to-many rendezvous. And even more misterious entries of both a protected object and a task, sort of "protected rendezvous"! (:-)) -- As for prefix syntax, I would prefer an explicit renaming: procedure Foo (X : T, Y : T); procedure T.Foo (Z : T) renames Foo (X=>Z, Y=>with); -- (:-)) However prefix syntax is too often misleading. It is unusable for binary operations and multiple dispatching operations (if Ada would have them). -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de