These are chat archives for ChaiScript/ChaiScript

Apr 2015
Victor Lopez
Apr 09 2015 22:15
I've found a crash when adding derived functions
It compiles but crashes when adding.
I'll try to check if the inheritance sample solves the example case.
Victor Lopez
Apr 09 2015 22:45
It's a bit strange how polymorphism is handled but I think it's fine to let the user to explicitly set the inheritance hierarchy. Everything is fine now, as it seems. Just one thing: I still don't have really clear what chaiscript::Std_Lib::library() does, does it include the std runtime? Like std::vector, std::map and such?
Jason Turner
Apr 09 2015 23:03
I'm surprised you had a crash, I'll check into that. And yes, that adds the vector/map/string functions. The idea was to just give the user the option to compile it in or load it dynamically to potentially save on compile time. IMO, the best use is to firewall the ChaiScript parts so they only need to compile if you change what you are registering with ChaiScript. @arBmind made a good example of that with his code
FYI: ChaiScript/ChaiScript#166
Also, there's no way to detect at runtime in C++ if one type is derived from another type, I'm kind of forced to make the user specify what conversions they want to have available. C++17 is considering some compile time reflection capability, which would be huge for ChaiScript, you'd be able to then do something like: chai.add(MyType); and have it walk the members/methods/parent classes, etc