v.0.16.1
The major new feature in this version is OOP - well, poor man's OOP, that is.
Version 0.16.1 released to crates.io
The README
is officially transferred to The Rhai Book.
An online Playground is available.
Breaking changes
- The trait function
ModuleResolver::resolve
no longer takes aScope
as argument. - Functions defined in script now differentiates between using method-call style and normal function-call style.
The method-call style will bind the object to thethis
parameter instead of consuming the first parameter. - Imported modules are no longer stored in the
Scope
.Scope::push_module
is removed.
Therefore, cannot rely on module imports to persist across invocations using aScope
. AST::retain_functions
is used for another purpose. The oldAST::retain_functions
is renamed toAST::clear_statements
.
New features
- Support for function pointers via
Fn(name)
andFn.call(...)
syntax - a poor man's first-class function. - Support for calling script-defined functions in method-call style with
this
binding to the object. - Special support in object maps for OOP.
- Expanded the
AST
API for fine-tuned manipulation of functions.
Enhancements
- The Rhai Book is online. Most content in the original
README
was transferred to the Book. - New feature
internals
to expose internal data structures (e.g. the AST nodes).