Re: [go-nuts] Quick question about the new Contracts Draft Proposal
Yes, it should. Alan -- 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/556bf9b8-1e12-4459-a7b3-77925eb7d9ee%40googlegroups.com.
Re: [go-nuts] Quick question about the new Contracts Draft Proposal
In this: func Map(type S, Element)(s S, f func(Element) Element) S { Why is Slice not mentioned anywhere? Shouldn't it be: func Map(type S, Element Slice) [..] On Tuesday, 30 July 2019 09:04:26 UTC+9, Ian Lance Taylor wrote: > > On Mon, Jul 29, 2019 at 2:35 PM Mandolyte > > wrote: > > > > In this code snippet: > >> > >> func Map(type S, Element)(s S, f func(Element) Element) S { > >> r := make(S, len(s)) > >> for i, v := range s { > >> r[i] = f(s) > >> } > >> return r > >> } > > > > Shouldn't the line in the loop be: r[i] = f(v) > > Yes. Thanks. > > Ian > > > On Monday, July 29, 2019 at 2:17:22 PM UTC-4, Ian Lance Taylor wrote: > >> > >> On Sun, Jul 28, 2019 at 1:15 PM Jon Bodner > wrote: > >> > > >> > I did a first read through the proposal and it looks very good. I had > one question: when giving the example of how to implement Sorting using > orderedSlice, the type parameter is declared to be comparable. Should that > be contracts.Ordered? > >> > >> Yes, thanks. Will update. > >> > >> 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 golan...@googlegroups.com . > > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/87f10070-394b-4500-a8d3-567562e12d5d%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/96e76897-ff96-443b-aba0-724f506efba8%40googlegroups.com.
Re: [go-nuts] Quick question about the new Contracts Draft Proposal
On Mon, Jul 29, 2019 at 2:35 PM Mandolyte wrote: > > In this code snippet: >> >> func Map(type S, Element)(s S, f func(Element) Element) S { >> r := make(S, len(s)) >> for i, v := range s { >> r[i] = f(s) >> } >> return r >> } > > Shouldn't the line in the loop be: r[i] = f(v) Yes. Thanks. Ian > On Monday, July 29, 2019 at 2:17:22 PM UTC-4, Ian Lance Taylor wrote: >> >> On Sun, Jul 28, 2019 at 1:15 PM Jon Bodner wrote: >> > >> > I did a first read through the proposal and it looks very good. I had one >> > question: when giving the example of how to implement Sorting using >> > orderedSlice, the type parameter is declared to be comparable. Should that >> > be contracts.Ordered? >> >> Yes, thanks. Will update. >> >> 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/87f10070-394b-4500-a8d3-567562e12d5d%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/CAOyqgcWGezszygOqgRzyxF7KqXw5R9gbEPo52FLdXBguGfFx-A%40mail.gmail.com.
Re: [go-nuts] Quick question about the new Contracts Draft Proposal
In this code snippet: > func Map(type S, Element)(s S, f func(Element) Element) S { > r := make(S, len(s)) > for i, v := range s { > r[i] = f(s) > } > return r} > > Shouldn't the line in the loop be: r[i] = f(v) On Monday, July 29, 2019 at 2:17:22 PM UTC-4, Ian Lance Taylor wrote: > > On Sun, Jul 28, 2019 at 1:15 PM Jon Bodner > wrote: > > > > I did a first read through the proposal and it looks very good. I had > one question: when giving the example of how to implement Sorting using > orderedSlice, the type parameter is declared to be comparable. Should that > be contracts.Ordered? > > Yes, thanks. Will update. > > 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/87f10070-394b-4500-a8d3-567562e12d5d%40googlegroups.com.
Re: [go-nuts] Quick question about the new Contracts Draft Proposal
On Sun, Jul 28, 2019 at 1:15 PM Jon Bodner wrote: > > I did a first read through the proposal and it looks very good. I had one > question: when giving the example of how to implement Sorting using > orderedSlice, the type parameter is declared to be comparable. Should that be > contracts.Ordered? Yes, thanks. Will update. 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/CAOyqgcUewsgOqVz%2BUw9J%2BqO8YqtPW46KGPFn4z6BQ8kbi%2BYcHA%40mail.gmail.com.
[go-nuts] Quick question about the new Contracts Draft Proposal
I missed this. Do you have a link to the proposal? -- 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/693ac121-0e94-4448-af6d-044e3c7c22df%40googlegroups.com.
[go-nuts] Quick question about the new Contracts Draft Proposal
Hello, I did a first read through the proposal and it looks very good. I had one question: when giving the example of how to implement Sorting using orderedSlice, the type parameter is declared to be comparable. Should that be contracts.Ordered? Thanks, Jon -- 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/2862bc74-7a30-495d-93d0-fa06291bf915%40googlegroups.com.