Disclaimer: I am a complete newbie with C, but I\'ve been playing with it trying to mimic some features of classes. Ok, I know that if I want to go that way I should lea
Did you have a look at Google's Go? It's basically a modernized C where things are done somewhat in the way you suggested. It has parameter polymorphisms. So you don't have to do this:
static void printFoo(struct foo self) {
printf("This is bar: %d\n", self.bar);
}
In Go it can be done this way:
static void print(Foo self) {
printf("This is foo: %d\n", self.foo);
}
static void print(Bar self) {
printf("This is bar: %d\n", self.bar);
}
In Go Foo and Bar would also be structs. So you are basically on the samet track as the Go language designers.
For an overview of Go see http://golang.org/doc/effective_go.html This is the Go main language description: http://golang.org/doc/effective_go.html