On Monday, 19 December 2016 at 14:09:47 UTC, pineapple wrote:
This is a shortcoming of Phobos - here is a package of sorting
algorithms including some that do not require their inputs to
be mutable, random access, and/or finite:
On Monday, 19 December 2016 at 12:45:48 UTC, Nicholas Wilson
wrote:
Ah, oh well. It was nice in theory.
Indeed. Thank you for trying Nicholas :)
auto word = data.map!(reduce!max).array.map!"a[1]".array;
you want
auto word = data.map!"a[1]".map!(reduce!max).array;
Problem max has to
On Monday, 19 December 2016 at 09:24:38 UTC, Ali wrote:
Ok so laziness stops as soon as sort is required on a range
then? Ahh, because in place algorithms? Are there any plans in
D to make is to that you can output copies to collections so
that you could do something like filter.transpose.sort
On Monday, 19 December 2016 at 11:42:55 UTC, Ali wrote:
On Monday, 19 December 2016 at 10:03:34 UTC, Nicholas Wilson
wrote:
[...]
The seedless version without the typeof(a)(b[0], b[1]) hack
(with default inited T) seems to crap out with:
[...]
Ah, oh well. It was nice in theory.
[...]
On Monday, 19 December 2016 at 10:03:34 UTC, Nicholas Wilson
wrote:
On Monday, 19 December 2016 at 09:24:38 UTC, Ali wrote:
On Monday, 19 December 2016 at 00:11:49 UTC, Nicholas Wilson
wrote:
[...]
Ok so laziness stops as soon as sort is required on a range
then?
No. Because a lazy range
On Monday, 19 December 2016 at 09:24:38 UTC, Ali wrote:
On Monday, 19 December 2016 at 00:11:49 UTC, Nicholas Wilson
wrote:
[...]
Ok so laziness stops as soon as sort is required on a range
then?
No. Because a lazy range is not random access, and therefore does
not meet sorts requirement.
On Monday, 19 December 2016 at 00:11:49 UTC, Nicholas Wilson
wrote:
On Sunday, 18 December 2016 at 22:26:50 UTC, Ali wrote:
1. The first line with the splitting, I need to use .array
three times. The last one I understand is because on "line 2"
I alias T as the type of the data, and if I
On Sunday, 18 December 2016 at 22:26:50 UTC, Ali wrote:
Hey, so I have this data file that has a list of a string of
characters separated by new lines. The task is to find the most
common letter in each column. Ie if file is:
abc
axy
cxc
Then the letters are a (column 1), x and c.
I've
Hey, so I have this data file that has a list of a string of
characters separated by new lines. The task is to find the most
common letter in each column. Ie if file is:
abc
axy
cxc
Then the letters are a (column 1), x and c.
I've written the code to do this at compile time. But I have a