Repository navigation
v.0.19.2
This version adds a variable resolver with the ability to short-circuit variable access,
plus a whole bunch of array methods.
Version 0.19.2 released to crates.io.
Breaking changes
AST::iter_functionsnow returns an iterator instead of taking a closure.Module::get_script_function_by_signaturerenamed toModule::get_script_fnand returns&<Shared<ScriptFnDef>>.Module::num_fn,Module::num_varandModule::num_iterare removed and merged intoModule::count.- The
merge_namespacesparameter toModule::eval_ast_as_newis removed and now defaults totrue. GlobalFileModuleResolveris removed because its performance gain over theFileModuleResolveris no longer very significant.- The following
EvalAltResultvariants are removed and merged intoEvalAltResult::ErrorMismatchDataType:ErrorCharMismatch,ErrorNumericIndexExpr,ErrorStringIndexExpr,ErrorImportExpr,ErrorLogicGuard,ErrorBooleanArgMismatch Scope::iter_rawreturns an iterator with an additional field indicating whether the variable is constant or not.rhai::serandrhai::denamespaces are merged intorhai::serde.- New reserved symbols:
++,--,..,.... - Callback signature for custom syntax implementation function is changed to allow for more flexibility.
- Default call stack depth for
debugbuilds is reduced to 12 (from 16). - Precedence for
~is raised, whileinis moved below logic comparison operators.
New features
- New
Engine::on_varto register a variable resolver. conststatements can now take any expression (or none at all) instead of only constant values.OptimizationLevel::Simplenow eagerly evaluates built-in binary operators of primary types (if not overloaded).is_def_var()to detect if variable is defined, andis_def_fn()to detect if script function is defined.Dynamic::from(&str)now constructs aDynamicwith a copy of the string as value.AST::combineandAST::combine_filteredallows combining twoAST's without creating a new one.map,filter,reduce,reduce_rev,some,all,extract,splice,chopandsortfunctions for arrays.- New
Module::set_iterableandModule::set_iteratorto define type iterators more easily.Engine::register_iteratoris changed to use the simpler version.
Enhancements
- Many one-liners and few-liners are now marked
#[inline]or[inline(always)], just in case it helps when LTO is not turned on.