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
Shouldn't the line in the loop be: r[i] = f(v)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 }
func Map(type S, Element)(s S, f func(Element) Element) S {
func Map(type S, Element Slice) [..]
On Mon, Jul 29, 2019 at 2:35 PM Mandolyte <ceci...@gmail.com> 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 <j...@bodnerfamily.com> 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.