Mutating on eval stage will stack, same mutation is undertaken on every eval stage.
Scope
Remove three linking types (NoRef, Brw, BrwMut)
Always take &mut Data for eval function
Always take Arc<Mutex<Data>> for eval_async function
Always supply app_data: &T in for repl use
Provide mechanism to update app_data mutably (for another issue).
Reasoning
Having the ability to take three different reference types was initially a good idea. It became apparent however that typing the reference method was unnecessary. The borrow lifetime would always be just the eval function, and if using eval_async then relevant reference counters are required anyway.
The stacking mutation were also buggy, it goes against what would be expected of the repl. Only providing a immutable reference will stop this. A mechanism will have to be developed that allows a mutation to occur, and occur only once...
Problem
Scope
NoRef
,Brw
,BrwMut
)&mut Data
foreval
functionArc<Mutex<Data>>
foreval_async
functionapp_data: &T
in for repl useapp_data
mutably (for another issue).Reasoning
Having the ability to take three different reference types was initially a good idea. It became apparent however that typing the reference method was unnecessary. The borrow lifetime would always be just the
eval
function, and if usingeval_async
then relevant reference counters are required anyway.The stacking mutation were also buggy, it goes against what would be expected of the repl. Only providing a immutable reference will stop this. A mechanism will have to be developed that allows a mutation to occur, and occur only once...