Wed Jul 26 22:47:00 PDT 2000
I must be in an "OLS recovery mode" as I'm not being
incredibly productive. There
is a buttload of email to read/answer/delete/forget/ignore,
buttload of things
I want to do, and I'm incredibly lazy. I watched TV a lot
and after a while I noticed
that I was watching complete crap because nothing else was
on but I was too lazy to
go do something else.
Well no really I did some other stuff. Did bunch of
gnop/grapevine/gob hacking and
interestingly enough for you all (well who cares,
interesting for me anyway) dflat.
Download the newest example at dflat-0.2.1.tar.gz
The biggest change there is methods. Instead of doing
everything through virtual like
methods, I've changed it to using normal functions. With
one cool addition however.
The object creates further aliases to methods of ALL parent
objects. Thus for example
let's say you have a 'ref' method on the DF__Object and now
you have two objects,
one of type DF__Object and one of type DF__Lamp (from the
example), you can do:
DF__Object *object = DF__NEW(DF__Object);
DF__Lamp *lamp = DF__NEW(DF__Lamp);
/* now, so far normal */
DF__Object__ref(object);
/* watch this, no casting */
DF__Lamp__ref(lamp);
This all is achieved by incredibly abusing the preprocessor
to make
setting up such objects simple (as long as all parent
objects are setup
correctly you get things working painlessly without having
to know the parent
objects). The other addition was that I've added the zero
cost typesafe
upcasting. I'm gonna work up a simple thing like that for
GTK+ as well, though
GTK+ usually uses base class pointers and thus it doesn't do
that well. I am
however seriously thinking of adding it to my gob2 feature
list (will have to
parse headers though looking for typedefs, eek, fortunately
I can ignore
EVERYTHING except those and I can ignore most known system
headers to make this
quick).
Note to ramiro, pavel and all other C++ weirdos: Yes I know
C++ does this, does it better, will make my morning coffee
and give me a blowjob. To get a bigger laugh you should
look at
my glib static typesafe templates.