I tried but it gave me errors, maybe I'm doing it wrong.
i'm using genericBuild on a class
I just would like to do a Context.parse on a string representing a whole class structure (just like in a .hx file) like this:
var newType = 'class Test
{
public var count:Int = -1;
public function new(count:Int = -1)
{
this.count = count;
}
public function checkCount():Bool
{
if( count < 0 ) return false;
return true;
}
}
';
var typeExp = Context.parse(newType);
Is this even possible ? and if not why ? I can create a whole class with macro reification, why not this way ? would it be possible in the future ?
Wouldn't it be simpler to create whole new types that way ? we can even implement a template system and modify the whole structure without having to go through the whole macro system as this is just a string.
Thanks !