Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-07 Thread Martin Geisler
in other languages. > 1. https://golang.org/doc/faq#exceptions -- Martin Geisler -- 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+unsubsc

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-03 Thread Martin Geisler
Hi Chad, On Sat, Jul 2, 2016 at 10:43 AM, Chad <send2b...@gmail.com> wrote: > > On Saturday, July 2, 2016 at 10:23:04 AM UTC+2, Martin Geisler wrote: >> >> On Fri, Jul 1, 2016 at 4:01 PM, Chad <send...@gmail.com> wrote: >>> >>> On Friday, July 1

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-02 Thread Martin Geisler
ion -- and the kind of optimization the compiler can do when it knows the implementation of map and string. However, it shouldn't be part of the language specification. -- Martin Geisler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-02 Thread Martin Geisler
On Fri, Jul 1, 2016 at 4:01 PM, Chad <send2b...@gmail.com> wrote: > > > On Friday, July 1, 2016 at 3:44:10 PM UTC+2, Martin Geisler wrote: >> >> On Fri, Jul 1, 2016 at 12:52 PM, Chad <send...@gmail.com> wrote: >> > However, that it's a valid point you

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-01 Thread Martin Geisler
ilarly sized. I'm very new to Go, so please let me know if I'm missing anything? -- Martin Geisler -- 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 gola

Re: [go-nuts] Append to slice... what happens?

2016-07-01 Thread Martin Geisler
Hi Ian, On Mon, Jun 27, 2016 at 8:18 PM, Ian Lance Taylor <i...@golang.org> wrote: > On Sun, Jun 26, 2016 at 10:55 PM, Dan Kortschak > <dan.kortsc...@adelaide.edu.au> wrote: >> On Mon, 2016-06-27 at 07:49 +0200, Martin Geisler wrote: >>> BTW, I was about to say

Re: [go-nuts] Shuffle Items in a Slice

2016-06-27 Thread Martin Geisler
thing is frozen at some point in the past : the > clock, the randomness sources, and you can't make outgoing requests to > import randomness from the network. I found this blog post with a lot more background information: https://blog.golang.org/playground -- Martin Geisler -- You

Re: [go-nuts] Re: Shuffle Items in a Slice

2016-06-27 Thread Martin Geisler
Hi Val On Fri, Jun 24, 2016 at 2:48 PM, Val wrote: > 2 implementations here : > http://www.programming-idioms.org/idiom/10/shuffle-a-list/1564/go > > As for the map iteration trick, the runtime doesn't guarantee to randomize > anything, although it often tries to, so

Re: [go-nuts] Append to slice... what happens?

2016-06-26 Thread Martin Geisler
quot; like this and updates to one cannot affect the other. -- Martin Geisler -- 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

Re: [go-nuts] Shuffle Items in a Slice

2016-06-24 Thread Martin Geisler
ator to generate indexes into the map. Use these indexes to swap elements and permute the array as Konstantin mentioned (https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -- Martin Geisler -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.