Re:Grain: A strongly-typed functional programming language f...
by valenterry on Monday April 26, 2021 @12:33AM
(#26939258)
I believe the difference is that Rust implicitly creates a new scope when a variable of type X is (re)assigned with a different type. So you in rust you can write (python syntax)
and both of these variables will exist at the same time with different times and potentially referable to from the outside. In python that cannot work, because there are no types. That's why in python the behavior is to always overwrite the existing variable, or create a new one in a local scope _if and only if_ this scope is somehow specified, i.e. by declaring a function.
[ Parent
| on HN ]
There are no comments on this comment yet.