seems lite-c compiler accepts only __VA_ARGS__
So at end i managed to get what i wanted, but didnt bothered to make one multifunctional, but 2 ones which is good too.
#define this(struct, function) struct.function(struct)
#define thisp(struct, function, __VA_ARGS__) struct.function(struct, __VA_ARGS__)
target was to make something more object oriented.
Now i can make things like this.
typedef struct Human
{
all properties ..
//all functions
function walk(void* me);//as Human* pointer cant be used before struct is defined
function look_to(void* me, void* you);
}Human;
function walk(Human* human)
{do_something...}
function look_to(Human* me, Human* you)
{do_looking...}
Human_inic()
{
Human* lok_human = new(Human);//again macros which allocates memory
//-->all human properties
//and human function adding
lok_human.walk = walk;
lok_human.look_to = look_to;
return lok_human;
}
function main()
{
Human* lok_human = Human_inic();
Human* lok_other_human = Human_inic();
this(lok_human, walk);
thisp(lok_human, look_to, lok_other_human);
}
Last edited by Arrovs; 08/11/13 20:53.