> Have the authors considered the implications of requiring the `type` 
keyword to use a generic type, not just at declaration time? Would this 
open up more syntax possibilities, such as `var x T<type int>`? This might 
be easier to read at the expense of five more characters of typing. It also 
could unify declaration and usage syntax even more than the proposal.

> This might be easier to read

Square brackets are easier to read. They are larger and catchier to eyes 
than lesser and greater signs used as brackets. And type-less syntax with 
mandatory constraint is even easier and feels like a great match with the 
rest of the language.


четверг, 6 августа 2020 г. в 22:25:19 UTC+3, Red Daly: 

> Have the authors considered the implications of requiring the `type` 
> keyword to use a generic type, not just at declaration time? Would this 
> open up more syntax possibilities, such as `var x T<type int>`? This might 
> be easier to read at the expense of five more characters of typing. It also 
> could unify declaration and usage syntax even more than the proposal.
>
> (Personally, I will accept any syntax. It's not realistic to expect this 
> for go2, but I would prefer if go3 ditched the C-style syntax altogether in 
> favor of a simpler, lisp-style syntax. Such a syntax would make it easier 
> to introduce language features like this one. Macros and metaprogramming 
> would also be much more straightforward for users to add useful 
> abstractions to the language.)
> On Thursday, August 6, 2020 at 7:15:08 AM UTC-7 Mike Schinkel wrote:
>
>> Hi Russ,
>>
>> In general, I think the proposal is a really good one.  I like that you 
>> abandoned contracts as interfaces were just too similar, and personally I 
>> like the choice of square brackets.
>>
>> There are a few aspects I do not like — 1.) no zero value and 2.) lack of 
>> covariance and contravariance — but perhaps those can be addressed in the 
>> future?
>>
>> All in all, I think the team has come up with a really good approach to 
>> generics, much better than the prior proposals.
>>
>> -Mike
>>
>> P.S. If there is one thing that piqued my interest about this thread it 
>> was Geoff Speicher's suggestion of a "generic" keyword, assuming type 
>> inference could be addressed. That approach would be even easier to reason 
>> about than the current proposal, I think.  That said, the current proposal 
>> is very good if type inference can not be addressed in Geoff Speicher's 
>> suggestion.
>>
>> On Wednesday, July 22, 2020 at 8:02:55 PM UTC-4 Russ Cox wrote:
>>
>>> So it sounds like everyone is in favor of the entire generics proposal 
>>> and all the semantics, and all we have left to hammer out is the bracket 
>>> characters? Do I have that right?
>>>
>>> Best,
>>> Russ
>>>
>>>
>>>
>>>

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fbc7a998-0e8d-46ff-a59a-23a63a8a5aa0n%40googlegroups.com.

Reply via email to