4 ms·
As a novice Rust programmer I agree with everything here lol. I don't know what a CFG is, and the 2nd code block not compiling breaks referential transparency w
by zaptheimpaler 3y ago
As a novice Rust programmer I agree with everything here lol. I don't know what a CFG is, and the 2nd code block not compiling breaks referential transparency which is very very weird to me.
If i understand correctly, the lexical scope idea is just saying that `slice` exists in scope until the end of the block regardless of what happens inside the block, whereas CFG is smarter and says that since we don't use slice after line 3, its not in scope anymore. So from my POV the non lexical scope is unequivocally better, more fine-grained reasoning from the type system.