Re:Go generics may use square brackets [] not parenthesis ()
by ckok on Wednesday July 15, 2020 @04:49AM
(#23842742)
Note that C#, Pascal don't "know" about known types during parsing like parsing C/C++ requires, it knows how a type is formatted, what it's looking for is:
'<' ValidType (',' ValidType)+ '>'
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.
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.