On that note, could anytone tell me please if I can retrieve an arbitrary variable defined in the script file? If I have an object called v in the script, so far the only way I can see to do this is chai.boxed_cast<SomeType>(chai.eval("v"));
1 reply
_
stellarpower
@stellarpower
@namelesshoodie:matrix.org ^^ forgot to ping
stellarpower
@stellarpower
It'll do for now, at least I suppose.
And no worries
stellarpower
@stellarpower
Is there a way I can get a property of a chai object by its name (as a string), inside chai itself?
I.e.
auto x = SomeType()
auto a = x.property("count"); auto b = x.count
print(a.to_string() + " == " + b.to_string)
stellarpower
@stellarpower
I see that the reflection module was removed some time ago. Is there some sort of alternative?
Or even just to get the type of an object? It's hard to debug dispatch issues, I have occasions when the backtrace I get from the eval exception isn't quite correct, and I also don't know what types my variables have been resolved to. I had something funky with a pair yesterday, where the instantiation hadn't been bootstrapped.