Re: Intermediate level D and open source projects to study

2016-05-11 Thread xtreak via Digitalmars-d-learn
On Thursday, 12 May 2016 at 00:35:04 UTC, Jon D wrote: On Wednesday, 11 May 2016 at 18:41:47 UTC, xtreak wrote: Hi, I am a D newbie. I worked through D programming language and programming in D books. I primarily use Python daily. I will be happy to know how I can go to intermediate level in

Re: DlangIDE Themes

2016-05-11 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 12:55:13 UTC, Chris wrote: Is there a way I can add my own themes? I've created a theme file and added it to views/resources.list However, it doesn't show up. "Default" and "Dark" seem to be hardwired somewhere in the source code. Indeed they are, just grep for

Re: Intermediate level D and open source projects to study

2016-05-11 Thread Jon D via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 18:41:47 UTC, xtreak wrote: Hi, I am a D newbie. I worked through D programming language and programming in D books. I primarily use Python daily. I will be happy to know how I can go to intermediate level in D. It will be hepful to have projects in D of high

Re: opDispatch and UFCS

2016-05-11 Thread John Colvin via Digitalmars-d-learn
On Thursday, 12 May 2016 at 00:04:43 UTC, Adam D. Ruppe wrote: On Wednesday, 11 May 2016 at 23:46:48 UTC, John Colvin wrote: Bug? Or am I misunderstanding how these two features are supposed to interact? I'm not sure what you actually expected there, but I'd note that in general, opDispatch

Re: opDispatch and UFCS

2016-05-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 23:46:48 UTC, John Colvin wrote: Bug? Or am I misunderstanding how these two features are supposed to interact? I'm not sure what you actually expected there, but I'd note that in general, opDispatch will always be preferred over UFCS, just like any other member

opDispatch and UFCS

2016-05-11 Thread John Colvin via Digitalmars-d-learn
struct S { int a; template opDispatch(string s) { template opDispatch(T...) { auto ref opDispatch(Args ...)(auto ref Args args) { return S(mixin(`a.` ~ s ~ (T.length ? `!T` : ``) ~ `(args)`)); } } } }

Keeping a reference to a linked list element

2016-05-11 Thread BLM768 via Digitalmars-d-learn
I just started working on a project in which it would be convenient to hold a reference to a specific entry in a DList. The interface doesn't seem to provide a way to get a pointer to a raw node struct, so about the best solution I can find is to get a range out of the list, pop elements until

Intermediate level D and open source projects to study

2016-05-11 Thread xtreak via Digitalmars-d-learn
Hi, I am a D newbie. I worked through D programming language and programming in D books. I primarily use Python daily. I will be happy to know how I can go to intermediate level in D. It will be hepful to have projects in D of high quality and also beginner friendly code that I can study to

Re: Parallel implementation of map

2016-05-11 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2016-05-11 at 13:01 +, VlasovRoman via Digitalmars-d-learn wrote: > On Wednesday, 11 May 2016 at 12:40:20 UTC, Daniel Kozak wrote: > > […] > > Why just not use:  > > https://dlang.org/phobos/std_parallelism.html#.TaskPool.map > > I was trying it, but this issue was stopping me. > >

Re: static import (v2.071.0)

2016-05-11 Thread Chris via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:28:00 UTC, Vladimir Panteleev wrote: On Wednesday, 11 May 2016 at 14:26:37 UTC, Vladimir Panteleev wrote: To elaborate - this doesn't imply that the code of everything in that module will always be placed in the executable. The exact details depend on the

Re: static import (v2.071.0)

2016-05-11 Thread Daniel Kozak via Digitalmars-d-learn
Dne středa 11. května 2016 16:32:18 CEST, Chris via Digitalmars-d-learn napsal(a): On Wednesday, 11 May 2016 at 14:28:00 UTC, Vladimir Panteleev wrote: On Wednesday, 11 May 2016 at 14:26:37 UTC, Vladimir Panteleev wrote: ... Hm. What's the point then of using import std.string : strip;

Re: static import (v2.071.0)

2016-05-11 Thread Chris via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:34:15 UTC, Edwin van Leeuwen wrote: On Wednesday, 11 May 2016 at 14:24:03 UTC, Chris wrote: I was wondering if `static import std.file;` `if (exists(file))` will only import `std.file.exists` or the whole lot of `std.file`? I want to find out what the best

Re: static import (v2.071.0)

2016-05-11 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:24:03 UTC, Chris wrote: I was wondering if `static import std.file;` `if (exists(file))` will only import `std.file.exists` or the whole lot of `std.file`? I want to find out what the best strategy for imports is now. I tend to do specified imports,

Re: static import (v2.071.0)

2016-05-11 Thread Chris via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:28:00 UTC, Vladimir Panteleev wrote: On Wednesday, 11 May 2016 at 14:26:37 UTC, Vladimir Panteleev wrote: On Wednesday, 11 May 2016 at 14:24:03 UTC, Chris wrote: I was wondering if `static import std.file;` `if (exists(file))` will only import

Re: What is up with building DMD (et al.) on Windows?

2016-05-11 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 10 May 2016 at 04:48:23 UTC, Jeremy DeHaan wrote: After DMD is built, other things keep getting built by DMC. I get more than a few errors due to having an eof character on the first line of some .h files, or something like that. I've never seen such an error. Do you have the

Re: static import (v2.071.0)

2016-05-11 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:26:37 UTC, Vladimir Panteleev wrote: On Wednesday, 11 May 2016 at 14:24:03 UTC, Chris wrote: I was wondering if `static import std.file;` `if (exists(file))` will only import `std.file.exists` or the whole lot of `std.file`? I want to find out what the best

Re: static import (v2.071.0)

2016-05-11 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:24:03 UTC, Chris wrote: I was wondering if `static import std.file;` `if (exists(file))` will only import `std.file.exists` or the whole lot of `std.file`? I want to find out what the best strategy for imports is now. Modules are always imported wholesale

Re: static import (v2.071.0)

2016-05-11 Thread Chris via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:18:16 UTC, Vladimir Panteleev wrote: On Wednesday, 11 May 2016 at 14:11:46 UTC, Chris wrote: I'm updating my code to 2.071.0 at the moment. Naturally, I get a lot of warnings like `module std.uni is not accessible here, perhaps add 'static import std.uni;'`

Re: static import (v2.071.0)

2016-05-11 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 14:11:46 UTC, Chris wrote: I'm updating my code to 2.071.0 at the moment. Naturally, I get a lot of warnings like `module std.uni is not accessible here, perhaps add 'static import std.uni;'` Will `static import` bloat my exe or simply access the members I

static import (v2.071.0)

2016-05-11 Thread Chris via Digitalmars-d-learn
I'm updating my code to 2.071.0 at the moment. Naturally, I get a lot of warnings like `module std.uni is not accessible here, perhaps add 'static import std.uni;'` Will `static import` bloat my exe or simply access the members I use?

Re: Parallel implementation of map

2016-05-11 Thread VlasovRoman via Digitalmars-d-learn
On Wednesday, 11 May 2016 at 12:40:20 UTC, Daniel Kozak wrote: Dne středa 11. května 2016 13:25:50 CEST, VlasovRoman via Digitalmars-d-learn napsal(a): Hey, guys! After many attempts pmap function was realized by me. This is analogous to taskPool.amap function, but I do not know how much

DlangIDE Themes

2016-05-11 Thread Chris via Digitalmars-d-learn
Is there a way I can add my own themes? I've created a theme file and added it to views/resources.list However, it doesn't show up. "Default" and "Dark" seem to be hardwired somewhere in the source code.

Re: Parallel implementation of map

2016-05-11 Thread Daniel Kozak via Digitalmars-d-learn
Dne středa 11. května 2016 13:25:50 CEST, VlasovRoman via Digitalmars-d-learn napsal(a): Hey, guys! After many attempts pmap function was realized by me. This is analogous to taskPool.amap function, but I do not know how much he is good. In simple tests, it showed a corresponding

Re: What is up with building DMD (et al.) on Windows?

2016-05-11 Thread Poul Jensen via Digitalmars-d-learn
On Tuesday, 10 May 2016 at 04:48:23 UTC, Jeremy DeHaan wrote: I went to build DMD on Windows for the first time tonight and I have to say that it was a terrible experience when compared with Linux. First issue I ran into was having HOST_DC not being set. I'm not sure if the DMD installer is

Parallel implementation of map

2016-05-11 Thread VlasovRoman via Digitalmars-d-learn
Hey, guys! After many attempts pmap function was realized by me. This is analogous to taskPool.amap function, but I do not know how much he is good. In simple tests, it showed a corresponding acceleration. I would like to ask you to advise me options to improve this function. If all this

Re: Using RefCounted in recursive structures and templates

2016-05-11 Thread Lodovico Giaretta via Digitalmars-d-learn
On Tuesday, 10 May 2016 at 22:10:06 UTC, ag0aep6g wrote: Am 10.05.2016 um 21:43 schrieb Lodovico Giaretta: import std.typecons: RefCounted; struct S { RefCounted!S s; // error: struct S no size yet for forward reference } This used to work with 2.067. I've filed a phobos regression

Re: Compiler silently ignores some method overloads

2016-05-11 Thread Marc Schütz via Digitalmars-d-learn
On Tuesday, 10 May 2016 at 22:17:00 UTC, pineapple wrote: On Tuesday, 10 May 2016 at 09:57:11 UTC, pineapple wrote: On Monday, 9 May 2016 at 18:56:15 UTC, Peter Häggman wrote: No problem here (tested with everything in a single module). I can't help more. Front end version ? Well, this is

Re: pop & popFront combined

2016-05-11 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 1 November 2014 at 13:22:34 UTC, Nordlöw wrote: https://github.com/nordlow/justd/blob/master/range_ex.d#L14 Moved here: https://github.com/nordlow/phobos-next/blob/master/src/range_ex.d#L66

Re: Restrict Combination of moveFront and popFront to Suitable Element Types

2016-05-11 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 1 November 2014 at 21:26:49 UTC, Nordlöw wrote: https://github.com/nordlow/justd/blob/master/range_ex.d#L14 Moved here https://github.com/nordlow/phobos-next/blob/master/src/range_ex.d#L66