DEV Community

Discussion on: Please don't "overchain" array methods

 
qm3ster profile image
Mihail Malo

Which means it needs to allocate the whole range, as an internal implementation.
I feel like whatever optimizations you can get out of hiding that implementation (Are there any, even?) are outweighed by the better decisions the developer will make when you shove this information in their face.

Thread Thread
 
jessekphillips profile image
Jesse Phillips

It isn't hidden, it won't compile if the range doesn't provide the needed operations. The simpilist solution is to call .array() before the call to sort.

Thread Thread
 
qm3ster profile image
Mihail Malo

That sounds awesome...
Are we talking about Dlang? :v

Thread Thread
 
jessekphillips profile image
Jesse Phillips
Thread Thread
 
qm3ster profile image
Mihail Malo • Edited

Aw yiss, get that D!
Homegirl on a mission.

Also: Oh no, this competes with Rust in a number of usecases, better say bad things about it all around just in case.

Also: Vector operations look sweet.