3 ms·
> the declaration on the right makes a certain amount of sense - you’re declaring an int, so that’s what you lead with. I'm sorry, but that doesn't make sense
by jolmg 8y ago
> the declaration on the right makes a certain amount of sense - you’re declaring an int, so that’s what you lead with.
I'm sorry, but that doesn't make sense to me. You say it as if it's the only sensible way to design a declaration syntax, but Haskell (and other languages) did it the other way just fine. I don't see how the differences in semantics between the 2 type systems give rise to a benefit in having the type expressed on the left.
If the design came to be decided like that, it seems it's simply not something that was put much thought over. That's fine too, since the limitations of the type system do not give rise to cases where this syntax choice becomes too big of an inconvenience.
Still, no benefits as far as I can see. Maybe it simply appealed to the designer's intuition more. Choosing because of that indicates that the choice was pretty arbitrary, though.
- andrewla 8y agoSorry -- I edited my reply above; the quoted sentence should be "the declaration on the _left_ makes a certain amount of sense". > You say it as if it's the only sensible way to design a declaration syntax I don't say that -- in fact, I'm replying to my own post saying that the declaration on the left was a mistake. My only point is that it is a design decision that has some historical grounding.