Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> ... I wasn't aware of named slices for some reason ....

I wasn't either. But I wouldn't call them a hidden feature of the language. A slice object is an object. So you can make it the value of a named variable, just like any other object. Somehow that wasn't obvious, though.

Now I'm wondering how else I might be able to improve my code by giving names to non-obvious things.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: