Re: Formal Review of std.range.ndslice

2015-12-14 Thread Stefan Frijters via Digitalmars-d
On Sunday, 13 December 2015 at 22:32:43 UTC, Ilya Yaroshenko wrote: Since it's a segfault in the compiler, should I put it on Bugzilla too? Yes 1. Please note in Bugzilla report that program code is incorrect (see example of correct above). 2. More reduced code can be used for report: void

Re: Formal Review of std.range.ndslice

2015-12-13 Thread Stefan Frijters via Digitalmars-d
On Friday, 11 December 2015 at 22:56:15 UTC, Ilya wrote: On Friday, 11 December 2015 at 19:31:14 UTC, Stefan Frijters wrote: [...] Slice!(N, T*) arr; [...] // compute length // more flexible construtors would be added after // allocatrs support for ndslice

Re: Formal Review of std.range.ndslice

2015-12-13 Thread Stefan Frijters via Digitalmars-d
On Sunday, 13 December 2015 at 15:59:19 UTC, Ilya Yaroshenko wrote: Could you please post reduced code example that caused dmd to segfault? Took dustmite about 6 hours to reduce, and then I went at it manually for a bit, so this is the smallest I could get it: import

Re: Formal Review of std.range.ndslice

2015-12-11 Thread Stefan Frijters via Digitalmars-d
Today I've made an abortive attempt at replacing my code's [1] dependence on unstd.multidimarray [2] with ndslice. I'm guessing it's just me being stupid, but could anyone supply with some hints on how to do the conversion with a minimum of fuss? Basically I have an N-dimensional array (N is

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: Request for testers: GDC-5.1 Release Candidate branched

2015-04-19 Thread Stefan Frijters via Digitalmars-d
On Sunday, 19 April 2015 at 07:13:16 UTC, Iain Buclaw wrote: Hi, GCC-5.1 has hit RC, and so it's all rush again to get bug fixes in quick before the window closes. Packages are up on Debian: https://packages.debian.org/experimental/gdc-5 Latest changes however are on github:

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

Re: Dutch D Meetup

2015-02-24 Thread Stefan Frijters via Digitalmars-d
On Monday, 23 February 2015 at 22:20:50 UTC, Arjan wrote: On Monday, 23 February 2015 at 21:07:04 UTC, George Sapkin wrote: Seems like there are some local meetups starting across the globe, but no Dutch one so far. Are there any D users from the Netherlands that would want to meetup and share

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

Zero-length static array spec

2015-02-01 Thread Stefan Frijters via Digitalmars-d
So recently I ran into this discrepancy between the behaviour of dmd (and gdc) and ldc2: void test(int[] data) in { assert(data, data must be non-null.); } body { } void main() { import std.stdio; int[1] data1; writeln(data1); // [0] test(data1); // Passes assert(data1.ptr !is

Re: Zero-length static array spec

2015-02-01 Thread Stefan Frijters via Digitalmars-d
On Sunday, 1 February 2015 at 14:54:37 UTC, ketmar wrote: On Sun, 01 Feb 2015 14:42:31 +, Stefan Frijters wrote: It does not seem to say whether a zero-length array should have a valid address or not. i believe that zero-length array should not be `null`, as it's infinitely small, yet

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: Simplified signatures in generated documentation

2014-08-20 Thread Stefan Frijters via Digitalmars-d
The simplified signatures would be show for the main signatures, i.e. the ones with a light blue background, and the full signatures would be added at the end of the documentation for each symbol. I like it. Some of my code also features a lot of free functions with template constraints and

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

DDoc and private members / mixins / UDAs

2014-06-25 Thread Stefan Frijters via Digitalmars-d-learn
. Any tips to achieve this in a different fashion are also appreciated. Kind regards, Stefan Frijters

Re: Finally full multidimensional arrays support in D

2014-06-11 Thread Stefan Frijters via Digitalmars-d
On Tuesday, 10 June 2014 at 19:04:18 UTC, Stefan Frijters wrote: I've been using the multidimensional arrays for a while now, but recently I've run into a problem w.r.t. optimization: import std.stdio; import unstd.multidimarray; void main() { MultidimArray!(double, 3) arr; arr

Re: Finally full multidimensional arrays support in D

2014-06-10 Thread Stefan Frijters via Digitalmars-d
for my HPC test code, and I have not noticed any deleterious effects; would you accept a pull request to fix these? Kind regards, Stefan Frijters

Scalar + array operations

2014-05-21 Thread Stefan Frijters via Digitalmars-d-learn
: incompatible types for ((dfoo) * (ibar[])): 'double' and 'int[]' Is this by design? It was very surprising to me, especially since all other combinations do seem to work. Kind regards, Stefan Frijters

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
aggregate false // testattr } Any hints would be appreciated! Kind regards, Stefan Frijters

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

Re: Finally full multidimensional arrays support in D

2014-04-16 Thread Stefan Frijters via Digitalmars-d
On Monday, 17 March 2014 at 17:39:41 UTC, Denis Shelomovskij wrote: Multidimensional arrays indexing and slicing syntax is finally added [1] (thanks to Kenji Hara). So it was a good cause to update my multidimensional arrays library implementation and add support for the new syntax. So here we

Re: Starting D with a project in mind.

2013-10-16 Thread Stefan Frijters
On Wednesday, 16 October 2013 at 07:52:44 UTC, Andrew wrote: andrew@islay:~/dub$ ./build.sh Generating version file... Running gdmd... /usr/local/gdc/include/d/4.8.2/armv7l-unknown-linux-gnueabihf/core/time.di:224: error: this cannot be interpreted at compile time, because it has no

Re: Starting D with a project in mind.

2013-10-16 Thread Stefan Frijters
On Wednesday, 16 October 2013 at 09:11:16 UTC, Andrew wrote: As far as I know deimos is a set of official (?) bindings for common C libraries. I don't know dub's build process but I assume that if the build script would have worked for you it would have attempted to clone this repo

Re: Starting D with a project in mind.

2013-10-16 Thread Stefan Frijters
On Wednesday, 16 October 2013 at 19:18:53 UTC, Andrew wrote: I'm a very happy man ! Everything is built and working including dub and the http_server example from vibe.d. It's slow to build, but it executes quickly and strips down to about 3MB which is heavy but tolerable. Thanks to

Re: Starting D with a project in mind.

2013-10-15 Thread Stefan Frijters
On Tuesday, 15 October 2013 at 14:56:06 UTC, Dicebot wrote: On Tuesday, 15 October 2013 at 14:38:32 UTC, Andrew wrote: Is this something I can update easily ? If rebuilding GDC from sources so that it will catch 2.063.2 frontend version is an option - it may help. Looking at

Re: Starting D with a project in mind.

2013-10-15 Thread Stefan Frijters
On Tuesday, 15 October 2013 at 19:23:13 UTC, Andrew wrote: 2060L - seems I'm further advanced than everybody else :-) Sorry, I thought it was 2.052, but now I see it's well behind since it should be 2.063. I'm rebuilding again from the master. Aha, oops, I have the same 2060L, but that is

Re: Starting D with a project in mind.

2013-10-14 Thread Stefan Frijters
On Monday, 14 October 2013 at 07:36:03 UTC, Andrew wrote: Thanks Stefan, those were the instructions that I tried. With GDC, is it possible to generate portable intermediate C code so that I can compile D sources on the Mac and then just copy the resultant C code to an ARM debian machine and

Re: Starting D with a project in mind.

2013-10-11 Thread Stefan Frijters
On Friday, 11 October 2013 at 07:09:17 UTC, Andrew wrote: As Adam already said D on Pi is adventurous. For MongoDB and web stuff, you should look into Vibe.d [0]. For parsing I would suggest Pegged [1]. Welcome to D and Happy Hacking! :) [0] http://vibed.org/ [1]

Re: Rectangular multidimensional arrays for D

2013-10-09 Thread Stefan Frijters
On Wednesday, 9 October 2013 at 08:30:11 UTC, Denis Shelomovskij wrote: 09.10.2013 7:55, Nick B пишет: On Tuesday, 8 October 2013 at 17:26:46 UTC, Stefan Frijters wrote: andrei wrote: I too are interesteed in this area as well. Dennis do you only plan to focus on multidimensional arrays only

Re: Rectangular multidimensional arrays for D

2013-10-08 Thread Stefan Frijters
On Tuesday, 8 October 2013 at 14:41:47 UTC, Denis Shelomovskij wrote: I accidentally discovered Andrei wrote [1] multidimensional array implementation is needed. If it really is, I will work to revise the API and prepare my implementation [2] for review if nobody is doing it already. Also as