Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!rex!JNCS@uno.edu From: jncs@uno.edu Newsgroups: comp.lang.c++ Subject: Use of this in C++ compared to self in Smalltalk Message-ID: <0094742D.B7B638A0@uno.edu> Date: 17 Apr 91 15:13:45 GMT Sender: news@rex.cs.tulane.edu Reply-To: jncs@uno.edu Lines: 23 I am learning C++ having experience with Smalltalk. My question refers to the use of the pseudovariable "this". In Smalltalk, one can use the pseudovariable self, to refer to the object which received the message. In particular, one can use it inside of a method of one of the superclasses of the object, to send messages to it. (something like, [self amessage]). This allows to write methods at the superclass level which send messages to invoke methods which are implemented at the subclass level. Example : can I write : int C::foo (...) { ... this.message ... } where "message" is a virtual function declared in class C. Thanks J. Nino Computer Science Department Univ. of New Orleans