Re:Go Contracts – Draft Design
by atombender on Tuesday July 30, 2019 @07:06AM
(#20563702)
Agreed, though I think the syntax problem (too many parens) could be made more readable and Go-like by emphasizing the generic aspect and making it stand out visually -- leaving no doubt that you're in a section that's generic, and perhaps dissuading overuse by making it noisy. Perhaps something like:
For "contracts":
Every time you want to refer to a generic type you'd have to use the generic keyword, which encourages use of concrete types:
This is more or less how Modula-3 does it. Generics have dedicated syntax with a "generic" keyword.
[ Parent
| on HN ]
There are no comments on this comment yet.