Topic: Common baseclass for all - Strawman


Author: hattons@globalsymmetry.com ("Steven T. Hatton")
Date: Mon, 29 Mar 2004 06:03:08 +0000 (UTC)
Raw View
Steven T. Hatton wrote:

> In some programming languages there is a common baseclass for all (user
> defined) objects. This allows for certain functionality to be shared by
> all classes. Obviously, C++ accomplishes some of this without providing a
> common baseclass.
>
...

Pleas allow me to add a few comments to this.  I wish I had time, and
materials to gain a better foundation before proposing such a (seemingly)
radical change as I have proposed.  In particular, I would like to know of
any previous discussion a long these lines.  I will be happy to read the
archives of such a discussion if someone can point me in that direction.

I'm offering all of this as a strawman.  I would just like to know what
people think it might fix, provide, or break.  If I can defend the model or
modify it to address critiques, I will provide my view as to how any faults
might be addressed.  I'm certainly not claiming to *know* it is appropriate
for C++.  I don't claim to be an expert in the field of programming
language design.  I have studied several different languages over the
years, and have some idea how they are designed and implemented.

There are people reading this who can run circles around me when it comes to
implementing what I'm proposing.  I'm merely offering the suggestion
because it feels compelling to me.  I also have the sense it isn't quite as
radical as it may sound.  It may amount to paving dirt roads that already
exist.

All that having been said, one part of the model I failed to mention is the
idea that the program be a singleton instance of the baseclass of all other
classes.  I think this mean turning the global namespace into a
class/object. Do other namespaces become classes?

--
STH

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]