Update readme.md

This commit is contained in:
Amanpatel13 2020-10-04 17:54:06 +05:30 committed by GitHub
parent 7178460415
commit ff782411f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ techniques, working with the developer how they would expect it to work. Being
native C++ application, it has some advantages over existing embedded scripting native C++ application, it has some advantages over existing embedded scripting
languages: languages:
1. It uses a header-only approach, which makes it easy to integrate with 1. It uses a header-only approach, which makes it easier to integrate with
existing projects. existing projects.
2. It maintains type safety between your C++ application and the user scripts. 2. It maintains type safety between your C++ application and the user scripts.
3. It supports a variety of C++ techniques including callbacks, overloaded 3. It supports a variety of C++ techniques including callbacks, overloaded
@ -73,7 +73,7 @@ Usage
see below for an example. see below for an example.
Once instantiated, the engine is ready to start running ChaiScript source. You Once instantiated, the engine is ready to start running ChaiScript source. You
have two main options for processing ChaiScript source: a line at a time using have two(2) main options for processing ChaiScript source: a line at a time using
`chai.eval(string)` and a file at a time using `chai.eval_file(fname)` `chai.eval(string)` and a file at a time using `chai.eval_file(fname)`
To make functions in your C++ code visible to scripts, they must be registered To make functions in your C++ code visible to scripts, they must be registered
@ -110,7 +110,7 @@ double function(int i, double j)
return i * j; return i * j;
} }
int main() int main();
{ {
chaiscript::ChaiScript chai; chaiscript::ChaiScript chai;
chai.add(chaiscript::fun(&function), "function"); chai.add(chaiscript::fun(&function), "function");