Re: [go-nuts] [generics] Syntax feedback

2020-06-30 Thread Tyler Compton
Hi Andrey,

Unfortunately, I don't believe I can edit mailing list posts even on the
Google Groups page. Sorry to have missed your post originally!

On Sun, Jun 28, 2020 at 1:09 PM Andrey T. 
wrote:

> Tyler,
> May I humbly suggest
> https://groups.google.com/d/msg/golang-nuts/W3fSnH0w1G0/JbMkJrKICAAJ for
> an additional item for your list?
>
> Thank you very much,
>   Andrey
>
> On Saturday, June 27, 2020 at 11:46:23 AM UTC-6, Tyler Compton wrote:
>>
>> Hi Rob,
>>
>> This topic has been discussed many times on this list, so it's probably
>> best to look at and post in one of those threads. Let me take this chance
>> to collect as much information about this issue as I can in a single post.
>> Unfortunately, discoverability can sometimes be hard on mailing lists so
>> I don't blame you for not seeing all these.
>>
>> Responses on the subject:
>> Design draft talking about alternative syntax:
>> https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#why-not-use-the-syntax-like-c_and-java
>> Ian's justification for taking a wait-and-see approach to this syntax
>> issue: https://groups.google.com/g/golang-nuts/c/Rumm5HFhg_Q
>>
>> Threads:
>> Use "<>": https://groups.google.com/g/golang-nuts/c/LvkOBA2D_Bk
>> Use "<>": https://groups.google.com/g/golang-nuts/c/B1Q1dsLa5rk
>> Use "::" and other suggestions:
>> https://groups.google.com/g/golang-nuts/c/b0GydCIn7T0
>> Use "(<>)": https://groups.google.com/g/golang-nuts/c/tYwWeiMztiI
>> Use "<>" before the name of the type being defined:
>> https://groups.google.com/g/golang-nuts/c/TJWGbrx2o34
>> Put type parameters in the regular arguments list with a ":type" suffix:
>> https://groups.google.com/g/golang-nuts/c/K7s-5MeXuzM
>> Use "<>", with some kind of additional syntax to make parsing easier:
>> https://groups.google.com/g/golang-nuts/c/SaDkSQdgF9g
>> Use "<>": https://groups.google.com/g/golang-nuts/c/coi7YS0KPgQ
>> Use "<>": https://groups.google.com/g/golang-nuts/c/ydySSqZqi-0
>> Use ":[]": https://groups.google.com/g/golang-nuts/c/zGQq_I5r2jg
>> No specific suggestion:
>> https://groups.google.com/g/golang-nuts/c/mY_36VU5ij8
>>
>> --
> 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/32da9686-d144-4d35-924f-b2bb1de7d9b3o%40googlegroups.com
> 
> .
>

-- 
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/CAA%3DXfu2-F-TCVQs%2Boskgz54pN6noXTkdtnzZt3r7Aezwe-oBOw%40mail.gmail.com.


Re: [go-nuts] [generics] Syntax feedback

2020-06-28 Thread Andrey T.
Tyler,
May I humbly suggest 
https://groups.google.com/d/msg/golang-nuts/W3fSnH0w1G0/JbMkJrKICAAJ for an 
additional item for your list?

Thank you very much,
  Andrey

On Saturday, June 27, 2020 at 11:46:23 AM UTC-6, Tyler Compton wrote:
>
> Hi Rob,
>
> This topic has been discussed many times on this list, so it's probably 
> best to look at and post in one of those threads. Let me take this chance 
> to collect as much information about this issue as I can in a single post.
> Unfortunately, discoverability can sometimes be hard on mailing lists so I 
> don't blame you for not seeing all these.
>
> Responses on the subject:
> Design draft talking about alternative syntax: 
> https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#why-not-use-the-syntax-like-c_and-java
> Ian's justification for taking a wait-and-see approach to this syntax 
> issue: https://groups.google.com/g/golang-nuts/c/Rumm5HFhg_Q
>
> Threads:
> Use "<>": https://groups.google.com/g/golang-nuts/c/LvkOBA2D_Bk
> Use "<>": https://groups.google.com/g/golang-nuts/c/B1Q1dsLa5rk
> Use "::" and other suggestions: 
> https://groups.google.com/g/golang-nuts/c/b0GydCIn7T0
> Use "(<>)": https://groups.google.com/g/golang-nuts/c/tYwWeiMztiI
> Use "<>" before the name of the type being defined: 
> https://groups.google.com/g/golang-nuts/c/TJWGbrx2o34
> Put type parameters in the regular arguments list with a ":type" suffix: 
> https://groups.google.com/g/golang-nuts/c/K7s-5MeXuzM
> Use "<>", with some kind of additional syntax to make parsing easier: 
> https://groups.google.com/g/golang-nuts/c/SaDkSQdgF9g
> Use "<>": https://groups.google.com/g/golang-nuts/c/coi7YS0KPgQ
> Use "<>": https://groups.google.com/g/golang-nuts/c/ydySSqZqi-0
> Use ":[]": https://groups.google.com/g/golang-nuts/c/zGQq_I5r2jg
> No specific suggestion: 
> https://groups.google.com/g/golang-nuts/c/mY_36VU5ij8
>
>

-- 
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/32da9686-d144-4d35-924f-b2bb1de7d9b3o%40googlegroups.com.


Re: [go-nuts] [generics] Syntax feedback

2020-06-27 Thread Ian Lance Taylor
On Sat, Jun 27, 2020 at 10:46 AM Tyler Compton  wrote:
>
> This topic has been discussed many times on this list, so it's probably best 
> to look at and post in one of those threads. Let me take this chance to 
> collect as much information about this issue as I can in a single post.
> Unfortunately, discoverability can sometimes be hard on mailing lists so I 
> don't blame you for not seeing all these.
>
> Responses on the subject:
> Design draft talking about alternative syntax: 
> https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#why-not-use-the-syntax-like-c_and-java
> Ian's justification for taking a wait-and-see approach to this syntax issue: 
> https://groups.google.com/g/golang-nuts/c/Rumm5HFhg_Q
>
> Threads:
> Use "<>": https://groups.google.com/g/golang-nuts/c/LvkOBA2D_Bk
> Use "<>": https://groups.google.com/g/golang-nuts/c/B1Q1dsLa5rk
> Use "::" and other suggestions: 
> https://groups.google.com/g/golang-nuts/c/b0GydCIn7T0
> Use "(<>)": https://groups.google.com/g/golang-nuts/c/tYwWeiMztiI
> Use "<>" before the name of the type being defined: 
> https://groups.google.com/g/golang-nuts/c/TJWGbrx2o34
> Put type parameters in the regular arguments list with a ":type" suffix: 
> https://groups.google.com/g/golang-nuts/c/K7s-5MeXuzM
> Use "<>", with some kind of additional syntax to make parsing easier: 
> https://groups.google.com/g/golang-nuts/c/SaDkSQdgF9g
> Use "<>": https://groups.google.com/g/golang-nuts/c/coi7YS0KPgQ
> Use "<>": https://groups.google.com/g/golang-nuts/c/ydySSqZqi-0
> Use ":[]": https://groups.google.com/g/golang-nuts/c/zGQq_I5r2jg
> No specific suggestion: https://groups.google.com/g/golang-nuts/c/mY_36VU5ij8

Thanks for collecting that list.

Ian

-- 
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/CAOyqgcU7Rck4s7WWnG6Jn2%3DqpLsG_xMXkROU1XeLm%3DOZLK0thQ%40mail.gmail.com.


Re: [go-nuts] [generics] Syntax feedback

2020-06-27 Thread t hepudds
Hi Tyler,

I just wanted to say a quick thank you for pulling those references together 
and your thoughtful response in this thread. 

Hopefully the time you spent doing that will help additional gophers as the 
generics discussion continues on this list.

Regards,
thepudds

-- 
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/e2c1cb6a-06e7-48ad-9dce-145513ac0b61o%40googlegroups.com.


Re: [go-nuts] [generics] Syntax feedback

2020-06-27 Thread Tyler Compton
Hi Rob,

This topic has been discussed many times on this list, so it's probably
best to look at and post in one of those threads. Let me take this chance
to collect as much information about this issue as I can in a single post.
Unfortunately, discoverability can sometimes be hard on mailing lists so I
don't blame you for not seeing all these.

Responses on the subject:
Design draft talking about alternative syntax:
https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#why-not-use-the-syntax-like-c_and-java
Ian's justification for taking a wait-and-see approach to this syntax
issue: https://groups.google.com/g/golang-nuts/c/Rumm5HFhg_Q

Threads:
Use "<>": https://groups.google.com/g/golang-nuts/c/LvkOBA2D_Bk
Use "<>": https://groups.google.com/g/golang-nuts/c/B1Q1dsLa5rk
Use "::" and other suggestions:
https://groups.google.com/g/golang-nuts/c/b0GydCIn7T0
Use "(<>)": https://groups.google.com/g/golang-nuts/c/tYwWeiMztiI
Use "<>" before the name of the type being defined:
https://groups.google.com/g/golang-nuts/c/TJWGbrx2o34
Put type parameters in the regular arguments list with a ":type" suffix:
https://groups.google.com/g/golang-nuts/c/K7s-5MeXuzM
Use "<>", with some kind of additional syntax to make parsing easier:
https://groups.google.com/g/golang-nuts/c/SaDkSQdgF9g
Use "<>": https://groups.google.com/g/golang-nuts/c/coi7YS0KPgQ
Use "<>": https://groups.google.com/g/golang-nuts/c/ydySSqZqi-0
Use ":[]": https://groups.google.com/g/golang-nuts/c/zGQq_I5r2jg
No specific suggestion:
https://groups.google.com/g/golang-nuts/c/mY_36VU5ij8


On Sat, Jun 27, 2020, 05:38 Rob Reid  wrote:

> Hi team,
>
> I wanted to provide some feedback on the syntax used in the generics
> proposal.
>
> When I first opened the Go 2 playground, it took me a while to realise
> that (type T) was a generic parameter and not a function parameter and that
> (s []T) was a function parameter and not a return parameter):
>
> func Print*(type T)(s []T)* {
> for _, v := range s {
> fmt.Print(v)
> }
> }
>
> I think this would start to look more confusing when there are return
> values (either single or multiple):
>
> func Something*(type T)(s []T) (T, T)*
>
> I think another character would server to improve the readability of the
> Print function in this example and hopefully prevent the time required to
> grok a generic function to someone who has not seen one in Go before:
>
> func Print*(s []T)* {
> for _, v := range s {
> fmt.Print(v)
> }
> }
>
> func Print*[type T](s []T)* {
> for _, v := range s {
> fmt.Print(v)
> }
> }
>
>
> Cheers,
>
> Rob
>
> --
> 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/CA%2Bcy9cUuJqOWWwi4m-MSp6gxKLGC4oFNn6y1zYJgN0Aac31sFg%40mail.gmail.com
> 
> .
>

-- 
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/CAA%3DXfu2VxFv9DeBhpX1F6urHHTQLxka82P4JAZuQWuRQCsDfRA%40mail.gmail.com.


[go-nuts] [generics] Syntax feedback

2020-06-27 Thread Rob Reid
Hi team,

I wanted to provide some feedback on the syntax used in the generics
proposal.

When I first opened the Go 2 playground, it took me a while to realise that
(type T) was a generic parameter and not a function parameter and that (s
[]T) was a function parameter and not a return parameter):

func Print*(type T)(s []T)* {
for _, v := range s {
fmt.Print(v)
}
}

I think this would start to look more confusing when there are return
values (either single or multiple):

func Something*(type T)(s []T) (T, T)*

I think another character would server to improve the readability of the
Print function in this example and hopefully prevent the time required to
grok a generic function to someone who has not seen one in Go before:

func Print*(s []T)* {
for _, v := range s {
fmt.Print(v)
}
}

func Print*[type T](s []T)* {
for _, v := range s {
fmt.Print(v)
}
}


Cheers,

Rob

-- 
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/CA%2Bcy9cUuJqOWWwi4m-MSp6gxKLGC4oFNn6y1zYJgN0Aac31sFg%40mail.gmail.com.