Re: making a struct an inputRange with free functions

2018-04-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 18, 2018 20:39:46 jmh530 via Digitalmars-d-learn wrote: > On Monday, 16 April 2018 at 19:27:28 UTC, Jonathan M Davis wrote: > > [snip] > > It really would be nice if it worked with free functions... > > I was trying to get the example working with Atila's concepts > library

Re: making a struct an inputRange with free functions

2018-04-18 Thread jmh530 via Digitalmars-d-learn
On Monday, 16 April 2018 at 19:27:28 UTC, Jonathan M Davis wrote: [snip] It really would be nice if it worked with free functions... I was trying to get the example working with Atila's concepts library [1]. I tried re-writing the checkInputRange function so that UFCS is only used when

Re: Error calling geqrs function from lubeck package.

2018-04-18 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 17 April 2018 at 03:30:45 UTC, Jamie wrote: On Tuesday, 17 April 2018 at 03:26:25 UTC, Jamie wrote: Sorry it's really an error calling geqrs function from mir-lapack package. If you don't get an answer here, you can always file an issue at mir-lapack with a simple example.

Re: The case of -debug -O and: is breaking pure/@nogc/nothrow/@safe UB under -debug?

2018-04-18 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 18 April 2018 at 13:47:35 UTC, Jonathan M Davis wrote: Thanks for both your answers, Jonathan and Nicholas. To the extent that I'd like to explain this in a d-idioms post, here is a tentative synthesis of your answers (Jonathan M Davis and Nicholas Wilson): - breaking pure

Re: The case of -debug -O and: is breaking pure/@nogc/nothrow/@safe UB under -debug?

2018-04-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 18, 2018 13:15:08 Guillaume Piolat via Digitalmars-d- learn wrote: > The D specification says: > > "A ConditionalStatement that has a DebugCondition is called a > DebugStatement. DebugStatements have relaxed semantic checks in > that pure, @nogc, nothrow and @safe checks are

Re: The case of -debug -O and: is breaking pure/@nogc/nothrow/@safe UB under -debug?

2018-04-18 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 18 April 2018 at 13:15:08 UTC, Guillaume Piolat wrote: The D specification says: "A ConditionalStatement that has a DebugCondition is called a DebugStatement. DebugStatements have relaxed semantic checks in that pure, @nogc, nothrow and @safe checks are not done. Neither do

The case of -debug -O and: is breaking pure/@nogc/nothrow/@safe UB under -debug?

2018-04-18 Thread Guillaume Piolat via Digitalmars-d-learn
The D specification says: "A ConditionalStatement that has a DebugCondition is called a DebugStatement. DebugStatements have relaxed semantic checks in that pure, @nogc, nothrow and @safe checks are not done. Neither do DebugStatements influence the inference of pure, @nogc, nothrow and

Status of dstddb

2018-04-18 Thread Pasqui23 via Digitalmars-d-learn
What is the status of dstddb( https://code.dlang.org/packages/database )?Is it usable? What about entity( https://code.dlang.org/packages/entity )?

Re: Rotate array in writefln?

2018-04-18 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 18 April 2018 at 06:54:29 UTC, Chris Katko wrote: I need to rotate an array by 90 degrees, or have writefln figure that out. I need, say: 0 4 5 6 0 0 0 0 0 0 0 0 0 0 0 0 But it's outputting: 0 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 int [4][4] data; file.writeln(format("%(%-(%d

Re: Rotate array in writefln?

2018-04-18 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 18 April 2018 at 06:54:29 UTC, Chris Katko wrote: I need to rotate an array by 90 degrees, or have writefln figure that out. I need, say: 0 4 5 6 0 0 0 0 0 0 0 0 0 0 0 0 But it's outputting: 0 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 int [4][4] data; file.writeln(format("%(%-(%d

Rotate array in writefln?

2018-04-18 Thread Chris Katko via Digitalmars-d-learn
I need to rotate an array by 90 degrees, or have writefln figure that out. I need, say: 0 4 5 6 0 0 0 0 0 0 0 0 0 0 0 0 But it's outputting: 0 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 int [4][4] data; file.writeln(format("%(%-(%d %)\n%)", data));

Re: LockingTextWriter not an output range?

2018-04-18 Thread rikki cattermole via Digitalmars-d-learn
On 18/04/2018 6:28 PM, kookman wrote: The below static assert fails. Is this expected? Not the way I read the docs. static assert (isOutputRange(typeof(stdout.lockingTextWriter), char)); static assert (isOutputRange!(typeof(stdout.lockingTextWriter()), char));

Re: LockingTextWriter not an output range?

2018-04-18 Thread kookman via Digitalmars-d-learn
Typo corrected: static assert (isOutputRange!(typeof(stdout.lockingTextWriter), char));

LockingTextWriter not an output range?

2018-04-18 Thread kookman via Digitalmars-d-learn
The below static assert fails. Is this expected? Not the way I read the docs. static assert (isOutputRange(typeof(stdout.lockingTextWriter), char));

Re: Delegates and classes for custom code.

2018-04-18 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 18 April 2018 at 01:12:33 UTC, Chris Katko wrote: My only questions are: [snip] How's about this one: import std.stdio : writefln; struct data_to_access_t { int tacos; } class Abc(T, alias Fn) { T data; this(T data) { this.data = data; } void