Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!uakari.primate.wisc.edu!samsung!munnari.oz.au!brolga!uqcspe!batserver.cs.uq.oz.au!grue From: grue@batserver.cs.uq.oz.au (Frobozz) Newsgroups: comp.lang.c++ Subject: Re: asking an object for its type Message-ID: <7417@uqcspe.cs.uq.oz.au> Date: 21 Feb 91 22:54:06 GMT References: <23984@netcom.COM> <1190@sheol.UUCP> <1991Feb19.000449.22255@gpu.utcs.utoronto.ca> <27C2D580.3B49@tct.uucp> Sender: news@uqcspe.cs.uq.oz.au Reply-To: grue@batserver.cs.uq.oz.au Lines: 33 In <27C2D580.3B49@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: >According to craig@gpu.utcs.utoronto.ca (Craig Hubley): >>But in more intelligent O-O languages, asking the type, or better, >>asking if there is a diameter, is a fundamental operation in type >>Object that all objects can do. >C++ is statically typed. And there is no requirement that all classes >be derived from a hypthetical Object class. So the features you desire >cannot be accomplished in C++. >BTW, I happen to find C++ an excellent tool for _exactly_ those >reasons. I pay only for those OOP features I need, and no more. And if you go all the way back to Simula, you find that type asking is permitted (as is asking if something is a type or sub-type). Simula doesn't have a type object from which everything comes. Simula does maintain some prorgammer invisible type information which is quite anti the principles of C. So I don't suggest adding this feature to C++ (the programmer can always do it themselves). Pauli seeya Paul Dale | Internet/CSnet: grue@batserver.cs.uq.oz.au Dept of Computer Science| Bitnet: grue%batserver.cs.uq.oz.au@uunet.uu.net Uni of Qld | JANET: grue%batserver.cs.uq.oz.au@uk.ac.ukc Australia, 4072 | EAN: grue@batserver.cs.uq.oz | UUCP: uunet!munnari!batserver.cs.uq.oz!grue f4e6g4Qh4++ | JUNET: grue@batserver.cs.uq.oz.au --