3 ms·
The same thing could certainly be done in other languages. I'm not convinced as to the "relative ease". I find the use of a slice backed by a temporary array pa
by enneff 15y ago
The same thing could certainly be done in other languages. I'm not convinced as to the "relative ease". I find the use of a slice backed by a temporary array particularly cool.
In any case, this post was written to educate Go programmers, and not (primarily) to evangelize Go.
- supersillyus 15y agoAh, makes sense. I assumed it was intended to be evangelical. Also, the slice backed by inline array is a pretty great thing. It's cache-friendly, avoids extra allocations, and is pretty easy to use safely. Aside from D, I don't know of any other usable garbage-collected languages that can do this so nicely.