These are chat archives for ChaiScript/ChaiScript

9th
Apr 2015
Victor Lopez
@VictorJL
Apr 09 2015 22:15
I've found a crash when adding derived functions https://gist.github.com/VictorJL/be1d8d07ef5828dfee2c
It compiles but crashes when adding.
I'll try to check if the inheritance sample solves the example case.
Victor Lopez
@VictorJL
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
@lefticus
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 https://github.com/arBmind/Twofold-ChaiScript.
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