Skip to content

v0.20.2

Compare
Choose a tag to compare
@schungx schungx released this 26 May 09:35
9a54fd6

This version adds a number of convenience features:

  • Ability for a Dynamic to hold an i32 tag of arbitrary data

  • Simplifies dynamic properties access by falling back to an indexer (passing the name of the property as a string) when a property is not found.

Version 0.20.2 released to crates.io.

Bug fixes

  • Propagation of constants held in a custom scope now works properly instead of always replacing by ().

Breaking changes

  • Engine::disable_doc_comments is removed because doc-comments are now placed under the metadata feature flag.
  • Registering a custom syntax now only requires specifying whether the Scope is adjusted (i.e. whether variables are added or removed). There is no need to specify the number of variables added/removed.
  • Assigning to a property of a constant is now allowed and no longer raise an EvalAltResult::ErrorAssignmentToConstant error. This is to facilitate the Singleton pattern. Registered setter functions are automatically guarded against setters calling on constants and will continue to raise errors unless the pure attribute is present (for plugins).
  • If a property getter/setter is not found, an indexer with string index, if any, is tried.
  • The indexers API (Engine::register_indexer_XXX and Module::set_indexer_XXX) are now also exposed under no_index.

New features

  • Each Dynamic value can now contain arbitrary data (type i32) in the form of a tag. This is to use up otherwise wasted space in the Dynamic type.
  • A new internal feature no_smartstring to turn off SmartString for those rare cases that it is needed.
  • DynamicReadLock and DynamicWriteLoc are exposed under internals.
  • From<Shared<Locked<Dynamic>>> is added for Dynamic mapping directly to a shared value, together with support for Dynamic::from.
  • An indexer with string index acts as a fallback to a property getter/setter.

Enhancements

  • Registering a custom syntax now only requires specifying whether the Scope is adjusted (i.e. whether variables are added or removed). This allows more flexibility for cases where the number of new variables declared depends on internal logic.
  • Putting a pure attribute on a plugin property/index setter now enables it to be used on constants.