|
From: Mike R. <mik...@gm...> - 2008-02-24 09:05:36
|
It has become clear to me that the current mechanism for class
declaration is no longer viable. While code like
s_class (Derived, Base) {
....
};
has a certain aesthetic appeal, it is no longer worth while. I'm
still proud of the tricks I used to make it work, but ultimately the
following will prove more effective and simple -- and thus in line
with the principles of Sooc:
#define SType SObject
#define SParent SBase
s_class {
...
};
Pros:
Will allow new techniques for wrapping messages in methods conveniently.
Will simplify the underlying implementation by reducing the need for
redundancy such as obscure pointers to Sooc-instantiated functions.
Will not require the header author additionally to "#define SHide
MyType" in order to enable data hiding; hence data hiding will always
be possible.
Will enable more flexible section ordering of s_class, etc. blocks.
Probably the only requirement will be that methods (not members) come
first, which is simpler and more sensible than the current required
order. This will also allow somewhat less memory to be used by class
metadata structures.
Will potentially allow more flexible expansion that is not yet
foreseen (indeed, failure to foresee the issues we are confronting to
day is part of what led us to believe that the existing system was
viable)
Cons:
Somewhat less cute.
I think this top-of-the-head list is more than sufficient to show that
we should revert to the #define technique that we used once upon a
time. If you have anything to add to the pro/con list, do let me
know. I will try to make this [fairly drastic] change in the near
future.
-Mike
|