mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Updated cheatsheet.md
- Simplified the part about ChaiScript initialization - Added a link to the ChaiScriptExtras helper library - Removed the Subsection about built-ins, because they are not longer in the code
This commit is contained in:
parent
8c7ea9bd32
commit
cba13f94d6
@ -11,13 +11,11 @@ ChaiScript tries to follow the [Semantic Versioning](http://semver.org/) scheme.
|
|||||||
# Initializing ChaiScript
|
# Initializing ChaiScript
|
||||||
|
|
||||||
```
|
```
|
||||||
chaiscript::ChaiScript chai; // loads stdlib from loadable module on file system
|
chaiscript::ChaiScript chai; // initializes ChaiScript, adding the standard ChaiScript types (map, string, ...)
|
||||||
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library()); // compiles in stdlib
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that ChaiScript cannot be used as a global / static object unless it is being compiled with `CHAISCRIPT_NO_THREADS`.
|
Note that ChaiScript cannot be used as a global / static object unless it is being compiled with `CHAISCRIPT_NO_THREADS`.
|
||||||
|
|
||||||
|
|
||||||
# Adding Things To The Engine
|
# Adding Things To The Engine
|
||||||
|
|
||||||
## Adding a Function / Method / Member
|
## Adding a Function / Method / Member
|
||||||
@ -200,6 +198,9 @@ chai.eval(R"_(
|
|||||||
)_");
|
)_");
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Adding STL math
|
||||||
|
ChaiScript itself does not provide a link to the math functions defined in `<cmath>`. You can either add them yourself, or use the [https://github.com/ChaiScript/ChaiScript_Extras](ChaiScript_Extras) helper library. (Which also provides some additional string functions.)
|
||||||
|
|
||||||
# Executing Script
|
# Executing Script
|
||||||
|
|
||||||
## General
|
## General
|
||||||
@ -571,23 +572,6 @@ If both a 2 parameter and a 3 parameter signature match, the 3 parameter functio
|
|||||||
|
|
||||||
# Built In Functions
|
# Built In Functions
|
||||||
|
|
||||||
## Disabling Built-Ins
|
|
||||||
|
|
||||||
When constructing a ChaiScript object, a vector of parameters can be passed in to disable or enable various built-in methods.
|
|
||||||
|
|
||||||
Current options:
|
|
||||||
|
|
||||||
```
|
|
||||||
enum class Options
|
|
||||||
{
|
|
||||||
Load_Modules,
|
|
||||||
No_Load_Modules,
|
|
||||||
External_Scripts,
|
|
||||||
No_External_Scripts
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Evaluation
|
## Evaluation
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user