On Thu, Jan 20, 2022 at 2:28 AM Manlio Perillo <manlio.peri...@gmail.com> wrote:
>
> 1. In 
> golang.org/design/43651-type-parameters#constraints-apply-even-after-constraint-type-inference,
>      there is a typo in the F4 function where FromString2 should be 
> FromStrings2

Thanks, fixed.

> 2. In golang.org/design/43651-type-parameters#operations-based-on-type-sets,
>     the link "defined later" in
>     "For special purpose operators like range loops, we permit their use
>     if the type parameter has a structural constraint, as <defined later>"
>     points to 
> golang.org/design/43651-type-parameters#Constraint-type-inference.
>     This feels confusing to me.  What does type inference have to do with 
> structural constraints?
>
>     I think that the definition of "structural type" and "structural 
> constraint" should be moved in a
>    different section.
>    Note that the term "structural constraint" is also used at the start of 
> the document, in
>    golang.org/design/43651-type-parameters#background, but I'm not sure if it 
> has the
>    meaning as the term used in the type inference section.

This is historical.  We introduced structural constraints for
constraint type inference, and then we started using them for some
operations.  I'm honestly not sure if we are going to keep doing that
going forward in future language versions.

I'm going to leave restructuring the documentation for later.

> 3. I noted that in the design there are no examples of a generic function 
> that use the range
>     statement over array, slice, string or map.  What is the reason?

Because we're not really sure how that is going to work.  In
particular range is quite a different operation over []byte and
string, so it would be unusual for a generic function to do that.


> P.S: should I report these issues on the Github Issue or on golang-dev?

Here is fine.  Thanks.

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/CAOyqgcX%3DHXz0QeHiB8CXLWW82cmiEG_xtXgZir3v9Z%2BG%2BU850w%40mail.gmail.com.

Reply via email to