I wonder how this is solved in Java, and C++, and C#, and...
I wonder how this is solved in Java, and C++, and C#, and...
It is definitely better for tooling not to need either, both for human readers and mechanical tools
The example in the mail shows that using angle brackets with Go would require full type information, making simple tools like gofmt impossible.
So now we're making language design decisions based on the limitations of the bonus linter?
My opinion of Golang drops more and more with every new detail I learn about it...
If that's there, it's a generic, else it's an identifier, and somewhere up the parsing chain will take that up as LessThan.
This operator is affectionately called the "turbofish" and can often be avoided because of very good type inference.
https://github.com/rust-lang/rust/blob/master/src/test/ui/ba...
The key to parsing that is line 35. Is the line a tuple containing two booleans, the first the result of a less than, the second the result of a greater than, or is the line a templated function call, with two template arguments, "woe" and "is"?
(It is the former in Rust, and the latter is the apparently magical third option of
oh::<woe, is>(me)
though of course "woe" and "is" would need to be types, not variables, in that case.)https://blog.dyvil.org/syntax/2016/04/19/angle-bracket-gener...
They even say that it is possible, but it makes producing useful error messages harder and makes the parser more complicated. they are not saying it is not possible, they are just saying it's not preferred to do.
a, b := w<type x,y>(z)