On Sat, Jun 20, 2020 at 7:30 PM T L <tapir....@gmail.com> wrote:
>
> On Saturday, June 20, 2020 at 4:48:07 PM UTC-4, Ian Lance Taylor wrote:
>>
>> On Sat, Jun 20, 2020 at 8:26 AM T L <tapi...@gmail.com> wrote:
>> >
>> > For example, if there is a builtin convertible(from, to) constraint,
>> > We can define a slice conversion function as
>> >
>> > func Convert(type Ta, Tb converitble(Ta, Tb)) (avs []Ta, _Tb) (bvs []Tb) {
>> >    bvs = make([]Tb, 0, len(avs)
>> >    for _, v := range avs {
>> >       bvs = append(bvs, Tb(v))
>> >    }
>> >    return bvs
>> > }
>> >
>> > We can use it as:
>> >
>> > iValues := Convert([]int{}{1, 2, 3}, interface{}(nil))
>>
>> https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#no-way-to-express-convertability
>>
>> Ian
>
>
> What are the rationales behind this?

I'm not sure I understand your question.  The section I mentioned is
under "Issues".  There is nothing here that seems to need a rationale.
It's an issue that needs to be considered before making a language
change proposal.

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

Reply via email to