Re: Range to array

2012-06-30 Thread bearophile
Namespace: Or should i prefer to use Ranges instead of arrays? There is no short answer to this question. Arrays and lazy ranges have different qualities, so they are better for different situations. Arrays use more memory, but in some situations they are faster. Lazy ranges can be a little

Re: Range to array

2012-06-30 Thread Jonathan M Davis
On Saturday, June 30, 2012 11:06:06 Namespace wrote: > But a Range don't match any function that accept arrays. Or > should i prefer to use Ranges instead of arrays? In general, functions should take ranges, not arrays. They're far more flexible that way. Requiring an array is generally overly re

Re: Range to array

2012-06-30 Thread Namespace
std.range already publicly import std.array. Oh, good to known. Not to mention, if you're using ranges heavily, it's not all that uncommon to not actually need std.array.array very often. In general, if you're constantly converting ranges to arrays, then I'd argue that you're doing somethi

Re: Range to array

2012-06-29 Thread Jonathan M Davis
On Saturday, June 30, 2012 01:43:44 Namespace wrote: > It is terrible to use a function of std.range if you are not > using "auto" as type all the time. > Why isn't there a convert function for the original type? > I know "array(Range)" of std.array is what i want, but why do i > have to import two