ChaiScript / ChaiScript_Extras

Repository for ChaiScript bindings sources.
BSD 3-Clause "New" or "Revised" License
32 stars 8 forks source link

ChaiScript Extras

User contributed wrappers and modules for ChaiScript.

Modules

Math

The Math module adds some standard math functions to ChaiScript.

Install

#include "chaiscript/extras/math.hpp"
chaiscript::ChaiScript chai;
auto mathlib = chaiscript::extras::math::bootstrap();
chai.add(mathlib);

Usage

var result = cos(0.5f)

Options

Compile with one of the following flags to enable or disable features...

String ID

Adds String ID support to ChaiScript.

Install

#include "chaiscript/extras/string_id.hpp"
auto string_idlib = chaiscript::extras::string_id::bootstrap();
chai.add(string_idlib);

String

Adds various string methods to extend how strings can be used in ChaiScript:

Install

#include "chaiscript/extras/string_methods.hpp"
auto stringmethods = chaiscript::extras::string_methods::bootstrap();
chai.add(stringmethods);

Usage

var input = "Hello, World!"
var output = input.replace("Hello", "Goodbye")
// => "Goodbye, World!"