Repository navigation
v0.20.2
This version adds a number of convenience features:
-
Ability for a
Dynamicto hold ani32tag 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_commentsis removed because doc-comments are now placed under themetadatafeature flag.- Registering a custom syntax now only requires specifying whether the
Scopeis 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::ErrorAssignmentToConstanterror. 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 thepureattribute 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_XXXandModule::set_indexer_XXX) are now also exposed underno_index.
New features
- Each
Dynamicvalue can now contain arbitrary data (typei32) in the form of a tag. This is to use up otherwise wasted space in theDynamictype. - A new internal feature
no_smartstringto turn offSmartStringfor those rare cases that it is needed. DynamicReadLockandDynamicWriteLocare exposed underinternals.From<Shared<Locked<Dynamic>>>is added forDynamicmapping 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
Scopeis 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
pureattribute on a plugin property/index setter now enables it to be used on constants.