On Mon, 2016-06-27 at 07:49 +0200, Martin Geisler wrote: > BTW, I was about to say that you could simplify the line one step > further with > > b := append(a[::len(a)], 3, 4) > > but that gives a compilation error: > > prog.go:11: middle index required in 3-index slice > > I wonder what the rationale is for this? It seems inconsistent to me > since the second (middle) index has a useful default (len(a)) that is > used when there are only two indexes used.
As I remember it, during the design discussions the possibility of using the shortened syntax you show above was considered, but rejected as an opening to bug entry (too much semantic weight on a single repeated character). -- 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. For more options, visit https://groups.google.com/d/optout.