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

Interesting, thanks.

I am right that this will extract consecutive views of the original array as pairs of (item, slice) elements? I guess array elements need not be copied, but there will still be a slight memory overhead, right? or is it some "zero-cost" abstraction?

I am not trying to attack the code for efficiency, just curious about what current implementations can make from this.



It shouldn't copy anything - I'd expect it to be optimized to not allocate any memory at all.




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

Search: