> ... 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.
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.