Skip to content

Instantly share code, notes, and snippets.

@lefticus
Last active July 23, 2019 12:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lefticus/9190735 to your computer and use it in GitHub Desktop.
Save lefticus/9190735 to your computer and use it in GitHub Desktop.
#include <chaiscript/chaiscript.hpp>
std::string helloWorld(const std::string &t_name) {
return "Hello " + t_name + "!";
}
int main() {
chaiscript::ChaiScript chai;
chai.add(chaiscript::fun(&helloWorld), "helloWorld");
chai.eval(R"(
puts(helloWorld("Bob"));
)");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment