v0.20.2
This version adds a number of convenience features:
-
Ability for a
Dynamic
to hold ani32
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 themetadata
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 thepure
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
andModule::set_indexer_XXX
) are now also exposed underno_index
.
New features
- Each
Dynamic
value can now contain arbitrary data (typei32
) in the form of a tag. This is to use up otherwise wasted space in theDynamic
type. - A new internal feature
no_smartstring
to turn offSmartString
for those rare cases that it is needed. DynamicReadLock
andDynamicWriteLoc
are exposed underinternals
.From<Shared<Locked<Dynamic>>>
is added forDynamic
mapping directly to a shared value, together with support forDynamic::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.