You could also throw an exception that you know is not going to get caught until the top level of the script. This is, unfortunately, how things like return values are currently implemented, since they require unrolling the call stack.

It seems like a reasonable way to deal with the desire to exit the script is to structure the flow of execution to allow for dropping out of the script. In other words, just let the script end when you want to end.

Thanks for the replies. I was considering adding a function that throws a type of object that indicates a good-exit. I just wanted to make sure there wasn’t already a feature for this purpose. As I delve further into ChaiScript, I have found there is much to the language that is only documented in the defect resolutions. The examples page is far behind, not including things like “switch” and “add_global_const”. It would be nice if someone who really knew the language well could take some time to update the examples and/or the documentation to include the depth of the language that you guys have worked so hard to add over the years.