Re: why does this error out?

2015-11-11 Thread lobo via Digitalmars-d-learn
On Thursday, 12 November 2015 at 02:36:23 UTC, lobo wrote: On Tuesday, 10 November 2015 at 14:25:19 UTC, steven kladitis wrote: On Tuesday, 10 November 2015 at 05:14:29 UTC, lobo wrote: [...] with dmd 2.069 I always get --> [1 and then the error no matter what I canhe that line to. Hmm,

Re: why does this error out?

2015-11-11 Thread lobo via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 14:25:19 UTC, steven kladitis wrote: On Tuesday, 10 November 2015 at 05:14:29 UTC, lobo wrote: On Tuesday, 10 November 2015 at 04:34:22 UTC, Cauterite wrote: Here's the output I get (DMD v2.068.2): [1, 3, 10, 12, 21, 30, 100, 102, 111, 120, 201, 210]

Re: why does this error out?

2015-11-10 Thread steven kladitis via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 05:14:29 UTC, lobo wrote: On Tuesday, 10 November 2015 at 04:34:22 UTC, Cauterite wrote: Here's the output I get (DMD v2.068.2): [1, 3, 10, 12, 21, 30, 100, 102, 111, 120, 201, 210] core.exception.AssertError@std\range\package.d(4603): Assertion failure

Re: why does this error out?

2015-11-09 Thread Cauterite via Digitalmars-d-learn
Here's the output I get (DMD v2.068.2): [1, 3, 10, 12, 21, 30, 100, 102, 111, 120, 201, 210] core.exception.AssertError@std\range\package.d(4603): Assertion failure

Re: why does this error out?

2015-11-09 Thread lobo via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 04:34:22 UTC, Cauterite wrote: Here's the output I get (DMD v2.068.2): [1, 3, 10, 12, 21, 30, 100, 102, 111, 120, 201, 210] core.exception.AssertError@std\range\package.d(4603): Assertion failure iota.front() is complaining the range is empty from this line.

why does this error out?

2015-11-09 Thread steven kladitis via Digitalmars-d-learn
void main() { import std.stdio, std.algorithm, std.range, std.conv; enum digSum = (int n) => n.text.map!(d => d - '0').sum; //enum harshads = iota(1, int.max).filter!(n => n % digSum(n) == 0); enum harshads = iota(1, 256).filter!(n => n % digSum(n) == 0);