Re: Measuring test coverage

2015-08-10 Thread Stefan Frijters via Digitalmars-d-learn
On Sunday, 9 August 2015 at 20:24:22 UTC, Alexei Bykov wrote: D has builtin support for coverage analysis but it produces only .lst files. This is a bit inconvenient. Is there any tool which can create something like an html report from .lst files? For now I'm using OpenCppCoverage which is not

std.parallelism and multidimensional arrays

2015-05-22 Thread Stefan Frijters via Digitalmars-d-learn
I have a code which does a lot of work on 2D/3D arrays, for which I use the 2.066 multidimensional slicing syntax through a fork of the Unstandard package [1]. Many times the order of operations doesn't matter and I thought I would give the parallelism module a try to try and get some easy

Re: Position of unittest attributes

2015-03-22 Thread Stefan Frijters via Digitalmars-d-learn
On Sunday, 22 March 2015 at 09:42:44 UTC, Rikki Cattermole wrote: On 22/03/2015 10:29 p.m., Stefan Frijters wrote: So I was trying to add some attributes to unittests in my code, but apparently they are only allowed *before* the unittest keyword, which I think makes it much harder to quickly

Position of unittest attributes

2015-03-22 Thread Stefan Frijters via Digitalmars-d-learn
So I was trying to add some attributes to unittests in my code, but apparently they are only allowed *before* the unittest keyword, which I think makes it much harder to quickly see the unittests when scrolling through the code: void foo() @safe pure nothrow @nogc { } // Ok - I normally use

Strange alias behaviour in template arguments

2015-03-03 Thread Stefan Frijters via Digitalmars-d-learn
So this is a strange thing I ran into while trying to streamline some templates in my code, where fixed-length arrays are passed as runtime arguments. I started out by trying variant fun2(), which disappointingly didn't work. fun3() then did its job but I was suspicious and tried fun4() and

Re: Strange alias behaviour in template arguments

2015-03-03 Thread Stefan Frijters via Digitalmars-d-learn
On Tuesday, 3 March 2015 at 14:40:45 UTC, anonymous wrote: On Tuesday, 3 March 2015 at 13:42:09 UTC, Stefan Frijters wrote: So this is a strange thing I ran into while trying to streamline some templates in my code, where fixed-length arrays are passed as runtime arguments. I started out by

Code coverage during CTFE

2015-02-03 Thread Stefan Frijters via Digitalmars-d-learn
Recently I've hooked my code up to coveralls.io using the convenient doveralls[1]. At first, I just did a dub test command before sending the data to coveralls, but my simulation code also has runnable tests in addition to unittests, which reaches many more lines. Today I've added an option

Dub subPackage buildType and output file name

2015-01-23 Thread Stefan Frijters via Digitalmars-d-learn
Currently I'm using dub for the first time and I've run into two problems so far. 1) I have defined buildTypes in dub.json, as well as subPackages. However, I want to always build all subPackages in release mode, regardless of the --build option I'm using to build the main program. I'm not

Re: multidimensional array

2014-09-28 Thread Stefan Frijters via Digitalmars-d-learn
On Sunday, 28 September 2014 at 04:24:25 UTC, Joel wrote: I'm trying to make a multidimensional array. I feel I've tried every thing. Is there a good guide explaining it? struct Spot { bool dot; } spots = new Spot[][](800,600); assert(spots[800-1][600-1].dot, Out of bounds); You

Foreach/opApply with @nogc

2014-08-24 Thread Stefan Frijters via Digitalmars-d-learn
Should this be possible? I admit to not being fully clear on the way delegates are handled, but maybe someone can shed some light? As an example I use a snippet Ali uses to demonstrate opApply: struct NumberRange { int begin; int end; int opApply(int delegate(ref int) @nogc operations)

Re: Foreach/opApply with @nogc

2014-08-24 Thread Stefan Frijters via Digitalmars-d-learn
On Sunday, 24 August 2014 at 14:34:03 UTC, bearophile wrote: ketmar: but i tend not to fill enhancement requests without corresponding patches, I agree that having a patch ready is much better. But people like me file hundreds of ERs without too much damage done, and many of them get

Re: Foreach/opApply with @nogc

2014-08-24 Thread Stefan Frijters via Digitalmars-d-learn
On Sunday, 24 August 2014 at 18:55:09 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 24 Aug 2014 11:45:14 -0700 Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Yeah, the only reason why the original code does not work is the write() expression in the foreach

Re: multidimensional indexing/slicing docs?

2014-08-06 Thread Stefan Frijters via Digitalmars-d-learn
On Wednesday, 6 August 2014 at 08:48:25 UTC, John Colvin wrote: Is there anywhere that describes what Kenji (it was Kenji wasn't it?) recently implemented for this? Not what you asked for, but maybe useful nonetheless: Denis Shelomovskij has written a multidimensional array implementation

Re: DDoc and private members / mixins / UDAs

2014-06-26 Thread Stefan Frijters via Digitalmars-d-learn
On Thursday, 26 June 2014 at 02:33:43 UTC, Mathias LANG wrote: On Wednesday, 25 June 2014 at 18:49:27 UTC, Stefan Frijters wrote: Let me preface this by admitting that I'm not sure I'm using the DDoc functionality properly at all, so let me know if my questions are bogus. Is it possible to:

DDoc and private members / mixins / UDAs

2014-06-25 Thread Stefan Frijters via Digitalmars-d-learn
Let me preface this by admitting that I'm not sure I'm using the DDoc functionality properly at all, so let me know if my questions are bogus. Is it possible to: - Add private members to documentation? - Have DDoc do its thing after mixins have been handled? - Access UDAs? To expand on the

Scalar + array operations

2014-05-21 Thread Stefan Frijters via Digitalmars-d-learn
When working on my current project (writing a numerical simulation code) I ran into the following issue when trying to multiply a vector (represented by a fixed-length array) by a scalar: import std.stdio; void main() { int ifoo = 2; int[3] ibar = 1; double dfoo = 2.0; double[3]

Re: Scalar + array operations

2014-05-21 Thread Stefan Frijters via Digitalmars-d-learn
On Wednesday, 21 May 2014 at 13:52:47 UTC, John Colvin wrote: Please file a bug, there's no reason for that not to work, it just needs to be implemented properly. Ok, thanks for confirming. Filed as https://issues.dlang.org/show_bug.cgi?id=12780 .

Re: Scalar + array operations

2014-05-21 Thread Stefan Frijters via Digitalmars-d-learn
On Wednesday, 21 May 2014 at 17:07:27 UTC, Francesco Cattoglio wrote: On Wednesday, 21 May 2014 at 13:52:47 UTC, John Colvin wrote: On Wednesday, 21 May 2014 at 11:45:57 UTC, Stefan Frijters wrote: I would have expected the last case to work as well, but I get testarr.d(20): Error:

Avoiding __traits(getAttributes, ...) on alias

2014-05-09 Thread Stefan Frijters via Digitalmars-d-learn
I've been playing with UDAs a bit and I wanted to find all variables with a particular attribute in various modules. I thought I had it cracked, until I added a module that contains an alias declaration, which makes it choke when trying to execute __traits(getAttributes, ...). A small example

Re: Avoiding __traits(getAttributes, ...) on alias

2014-05-09 Thread Stefan Frijters via Digitalmars-d-learn
On Friday, 9 May 2014 at 12:19:12 UTC, John Colvin wrote: On Friday, 9 May 2014 at 11:53:59 UTC, Stefan Frijters wrote: I've been playing with UDAs a bit and I wanted to find all variables with a particular attribute in various modules. I thought I had it cracked, until I added a module that