From cba13f94d675eaea428a00c25c45b5242657cfc5 Mon Sep 17 00:00:00 2001 From: vocaviking Date: Wed, 19 Dec 2018 13:03:30 +0100 Subject: [PATCH 1/2] 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 --- cheatsheet.md | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/cheatsheet.md b/cheatsheet.md index 81758062..350863fa 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -11,13 +11,11 @@ ChaiScript tries to follow the [Semantic Versioning](http://semver.org/) scheme. # Initializing ChaiScript ``` -chaiscript::ChaiScript chai; // loads stdlib from loadable module on file system -chaiscript::ChaiScript chai(chaiscript::Std_Lib::library()); // compiles in stdlib +chaiscript::ChaiScript chai; // initializes ChaiScript, adding the standard ChaiScript types (map, string, ...) ``` 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 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 ``. 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 ## General @@ -571,23 +572,6 @@ If both a 2 parameter and a 3 parameter signature match, the 3 parameter functio # 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 ``` From c0f217ababf0f5f07da3589159187c8907ae1005 Mon Sep 17 00:00:00 2001 From: vocaviking Date: Fri, 21 Dec 2018 15:43:52 +0100 Subject: [PATCH 2/2] Moved ChaiScript_Extras to the bottom --- cheatsheet.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cheatsheet.md b/cheatsheet.md index 350863fa..80d4b3a8 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -198,9 +198,6 @@ chai.eval(R"_( )_"); ``` -## Adding STL math -ChaiScript itself does not provide a link to the math functions defined in ``. 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 ## General @@ -587,3 +584,6 @@ Both `use` and `eval_file` search the 'usepaths' passed to the ChaiScript constr * `from_json` converts a JSON string into its strongly typed (map, vector, int, double, string) representations * `to_json` converts a ChaiScript object (either a `Object` or one of map, vector, int, double, string) tree into its JSON string representation + +## Extras +ChaiScript itself does not provide a link to the math functions defined in ``. 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.)