Skip to content

v.0.16.1

Compare
Choose a tag to compare
@schungx schungx released this 01 Jul 14:26
3b16fae

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 a Scope 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 the this 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 a Scope.
  • AST::retain_functions is used for another purpose. The old AST::retain_functions is renamed to AST::clear_statements.

New features

  • Support for function pointers via Fn(name) and Fn.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).