home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!think.com!linus!linus.mitre.org!virtual
- From: pathak@mitre.org (Heeren Pathak)
- Newsgroups: comp.lang.c++
- Subject: Re: Language extensions for run-time type identification
- Message-ID: <pathak-210792110123@virtual.mitre.org>
- Date: 21 Jul 92 15:36:25 GMT
- References: <EY048MK@netmbx.netmbx.de> <pathak-200792135100@virtual.mitre.org> <N3A5KQD@netmbx.netmbx.de>
- Sender: news@linus.mitre.org (News Service)
- Followup-To: comp.lang.c++,comp.std.c++
- Organization: Mitre Corporation
- Lines: 55
- Nntp-Posting-Host: virtual.mitre.org
-
- In article <N3A5KQD@netmbx.netmbx.de>, jrobie@netmbx.netmbx.de (Jonathan
- Robie) wrote:
- >
- > pathak@mitre.org (Heeren Pathak) writes:
- >
- > >In article <EY048MK@netmbx.netmbx.de>, jrobie@netmbx.netmbx.de (Jonathan
- > >Robie) wrote:
- > >>
- > >> shang@corp.mot.com (David (Lujun) Shang) writes:
- > >>
- > >> >The language should provide run time type checking as well as array bounds
- > >> >checking. You can also have a switch to turn off them if you like to.
- > >> >
- > >>
- > >> It may be important for compilers to provide such a switch since the
- > >> memory overhead needed to store type information for all classes can
- > >> be significant. Pragmas would be necessary to switch it on and off
- > >> since you might need it for some classes but not for others....messy,
- > >> isn't it?
- > >>
- >
- > >Why not use MI to provide a "standard" mix-in class that provides run-time
- > >identification?
- >
- > I assume you mean that this class would give access to the run-time
-
- This is exactly what I meant.
-
- > identification provided by the compiler, right? That might make sense,
- > but I don't like the idea of making the compiler look at the derivation
- > tree to see whether it should generate run time identification.
- >
-
- I don't see how this is any worse than using pragmas or having a new
- keyword to identify objects that use run-time identification. Could you
- explain the problem with the complier looking at the derivation tree? From
- my viewpoint, run-time id would be another characteristic of a class and
- all classes derived from it.
-
- > Obviously, no class is going to be able to generate run time identification
- > for objects including it or derived from it. How should it know the
- > relevant types?
- >
-
- Well, if the complier uses the class tree when it determines the type, it
- can generate "proper" run-time id for all objects in the tree. That is I
- suggest that people look at using MI instead of pragmas.
-
- -------------------------------------------------------------------------
- Heeren Pathak | Television is a device that permits
- pathak@mitre.org | people who haven't anything to do to
- Mitre Corporation | watch people who can't do anything.
- (617) 271-7465 | -- Fred Allen
- -------------------------------------------------------------------------
- Disclaimer: Mine not Mitre's.
-