On Sunday, October 16, 2016 at 2:56:42 PM UTC-7, Ian Lance Taylor wrote:
> > A function to insert a byte into a slice is conspicuous by its absence. 
> It's a one-liner. 
>     append(s[:p], append([]byte{b}, s[p:]...)...) 

This is already gobbledygook :) Does that read "Insert" to you? It doesn't 
to me.

> it's easy enough to write a helper function yourself. 

Of course, but two reasons for the stdlib are:
  foster semantic clarity in client code
  prevent innumerable variations across packages in the name and signature 
of a common function

To argue that this should go into the standard library, look at some 
> corpus of Go code and find out how often it occurs.  If it occurs 
> fairly often, you've got a good case. 

Fairly often; i.e. as often as Replace or Trim*? In my experience it passes 
that test.

That Insert and Delete are missing implies to me that there is something 
strange about such operations.

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.

Reply via email to