In the draft, it says:
"Why not use the syntax F<T> like C++ and Java?
When parsing code within a function, such as v := F<T>, at the point of 
seeing the < it's ambiguous whether we are seeing a type instantiation or 
an expression using the < operator. Resolving that requires effectively 
unbounded lookahead. In general we strive to keep the Go parser efficient."

Maybe adding type metadata to an identifier during parsing, and using the 
metadata of an identifier may resolve the ambiguous of type parameter or 
less operator.   For example, '<' after a variable or constant name is a 
less operator and '<' after a function or type name is a type parameter.

<> will be more readable than () and easier to identify type parameter and 
function call.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f8b79cec-6e8e-4d21-8c56-539cb6e7e4c8n%40googlegroups.com.

Reply via email to