Article View: comp.std.c++
Article #76Re: Expanding enumerators in inheriting classes
From: Bruce.Hoult
Date: Tue, 11 Aug 1992 13:39
Date: Tue, 11 Aug 1992 13:39
33 lines
2168 bytes
2168 bytes
In article <1992Aug10.200814.12809@ntmtv> hildum@ntmtv.UUCP (Eric Hildum) writes: > A language feature that I would like to see is support for inheritance upon > the builtin type enumerator. That is, I would like to define a number of > enumerators for an enumeration type, then use that enumeration type as a base > for a second enumerator with an expanded enumerator set, incorporating all the > base types enumerators and adding a number of new enumerators. > > Has something like this extension been suggested anywhere? When Wirth was adding object-oriented features to Modula-2 in creating Oberon he used the term "type extension" where we C++ers would use "derivation". Being a fan of orthogonality (where sensible) he wanted to be able to apply type extension to enumerated types. It seems that he could find no good way to do it and instead dropped enumerated types from the language entirely! Perhaps there is something nice that Wirth missed (and I seem to remember something about the problems in the Oberon documentation) but I wouldn't bet the farm on it... :-) -- Bruce (Dropping enumerations is one of the two things obviously missing from Oberon that Wirth had in both Pascal and Modula-2. The other is that Oberon only allows pointers to records (structures), not to built-in types or to arrays or other pointers. I suspect the reason has something to do with garbage collection.) -- Bruce.Hoult@bbs.actrix.gen.nz Twisted pair: +64 4 477 2116 BIX: brucehoult Last Resort: PO Box 4145 Wellington, NZ "Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB hard disk that fits in your pocket!" "Great! Is it PC compatible?"
Technical Details
Message-ID:
<1992Aug11.133926.28840@actrix.gen.nz>Path:
arc1-ca.pugleaf.net!sparky!uunet!comp.vuw.ac.nz!actrix!Bruce.HoultReferences:
<1992Aug10.200814.12809@ntmtv>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!comp.vuw.ac.nz!actrix!Bruce.Hoult From: Bruce.Hoult@bbs.actrix.gen.nz Subject: Re: Expanding enumerators in inheriting classes Organization: Actrix Information Exchange Date: Tue, 11 Aug 1992 13:39:26 GMT Message-ID: <1992Aug11.133926.28840@actrix.gen.nz> Keywords: inheritance, enumerator References: <1992Aug10.200814.12809@ntmtv> Sender: Bruce.Hoult@actrix.gen.nz (Bruce Hoult) Lines: 33