Re:Static Types Are for Perfectionists
by Jtsummers on Monday May 19, 2025 @04:18PM
(#44034357)
Not that you should ever write this in any language, but as an illustration:
This will not compile even though if it were allowed to execute it would, correctly, assign an integer to x. Python will happily interpret its equivalent:
Even giving the if-expression an explicit `true` constant for the condition, Rust won't accept that as a valid program even though we can prove that the result of the expression is always 1.
[ Parent
| on HN ]
There are no comments on this comment yet.