Closed ameliatastic closed 1 year ago
(Note that I know this isn't done yet, this will cause errors when a variable is re-assigned in the same scope. PR is here so that more eyes can get on this.)
Good to see the CI picking up these changes! Would it be worth adding an example that does a bit more scope stuff - maybe including lists and also tuples like you were talking about on the issue?
Yeah, absolutely. I'll quote you in the stability thread so that I don't forget.
Looks better now!
Here's the relevant generated code from Miguel's sample:
let mut myboolean = true;
let mut newnumber = 1f64;
let mut mylist = Mutable::new(vec![3f64]);
if number > 0f64 {
myboolean = false;
newnumber = 10f64;
index_assign!(mylist.borrow_mut(), mylist.wrapped_index(0), 4f64);
Assignments are happening the right spots again.
Explanation here.
Closes #73