[go-nuts] Re: Constraints for generics

2018-10-02 Thread Christian Surlykke
mandag den 1. oktober 2018 kl. 16.14.26 UTC+2 skrev komuW: > > I think you should add it to: > https://github.com/golang/go/wiki/Go2GenericsFeedback > Thanks for the pointer. I wasn't aware of that page. I've added it. br. Chr. -- You received this message because you are subscribed to th

[go-nuts] Constraints for generics

2018-09-30 Thread Christian Surlykke
Hi I made a proposal for generics with constraints about ½ a year ago, which I posted to the (very long) thread on issue 15292. I've now made a version 2 , in case anybody would like to read it. This version adapts to the ge

[go-nuts] Re: A way to detect closed channel

2017-11-08 Thread Christian Surlykke
This little pattern may also be useful: ticket := make(chan bool, 1) ticket <- true close(ticket) Now, first read from ticket will yield true, all subsequent reads will yield false. So any number of go-routines can do this if, but the call to close will happen at most once: if (<-ticket) {

[go-nuts] Re: Distinct types

2017-10-02 Thread Christian Surlykke
ng > > is a named type, its name is Dictionary > > And the rules of assignment permitted assignment from or to an unnamed > type. > > Aha, I see. Thanks for clarifying. br. Chr. > On Tuesday, 3 October 2017 06:26:44 UTC+11, Christian Surlykke wrote: >> >>

[go-nuts] Distinct types

2017-10-02 Thread Christian Surlykke
his a bug or 'working as intended'? If it's working as intended, can anyone explain the reasoning behind this? br. Christian Surlykke -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop