Hacker News new | ask | show | jobs
by gclaramunt 3771 days ago
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
1 comments

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.