Re:Functional Programming at Facebook
by gclaramunt on Friday February 26, 2016 @09:54AM
(#11181642)
Interestingly, Scala handles it http://pastebin.com/CT36K6Hj
It feels like an artifact of the REPL tho, as one shouldn't be able to redefine x
[ Parent
| on HN ]
Yep, statically typed languages tend to have no option but to handle this right. Otherwise, they risk unsoundness: Consider what would happen if you did `val x = "foo"` instead of `val x = 0`.
But there's still no type-level distinction between immutable and mutable bindings, which is why included Scala in the “anything goes” category.