Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ncar!hsdndev!cmcl2!uupsi!dorsaidm!koussari From: koussari@dorsai.com (Vahid Koussari) Newsgroups: comp.lang.c++ Subject: Re: Borland language extension virtual function = [ ... ]; Message-ID: Date: 28 Jun 91 23:58:07 GMT References: <1991Jun27.130247.5107@mathcs.sjsu.edu> Organization: The Dorsai Diplomatic Mission ( Mail address : user@dorsai.com ) Lines: 48 horstman@mathcs.sjsu.edu (Cay Horstmann) writes: > I just attended a product presentation by a Borland guy on their class > library for Microsoft Windows called ObjectVision. I was somewhat distressed > to see an odd construct > > class MyWindow : public TWindow > { // ... > public:: > virtual void paint() = [ WM_START + WM_PAINT ]; > // ... > }; > > (I am quoting from memory, so the details may not be correct 100%). The idea > is that the paint() function would be selected when the WM_PAINT message is > sent from MS Windows. > > They have a fancy name for this, dynamic message dispatching. > > Did anyone see this before? Supposedly it is supported in BCC 2.0. Is the > mechanism really tied to MS Windows, or does it something useful in a > general construct? > > The speaker (I believe the project head for ObjectVision--can't remember > his name) insisted that this did not violate any C++ standard, being "merely" > an extension. To me, this sounds like utter nonsense. Assuming for the moment > that the feature is indeed closely tied to Windows (or maybe other event- > driven UI that use small integers as message ID's), one of two things will > happen: > Nobody else will support it, and Borland C++ (otherwise an admirable > product) will be on the route that killed Pascal, with proprietary > extensions in every implementation. > > Every DOS vendor must support it to stay compatible, and Borland manages > to place a true wart into the de facto language without even bothering > to go through the ANSI committee. > > Maybe other netters have more info on this. My impression that the speaker > was an evil person was amplified when, upon his question what Borland could > do for us, I told him "Improve the Usenet support", and he answered "The > what?". > > Cay Could you explain the purpose of that funtion? This is the first time that I have seen this? Thank you.