Re: How to test templates for equality?

2014-07-06 Thread Uranuz via Digitalmars-d-learn
In this particular case, the only solution I know of is an awful hack: using .stringof and __traits(identifier, x) and then parse the strings: "Name!(int, double[string])" and "Name(T, U[V], U, V)" and then the fun begins: in the general case, you must then equate the arguments lists (recursi

Re: recursive definition error

2014-07-06 Thread Frustrated via Digitalmars-d-learn
So, I took all the code surrounding the error message(which was a lot of code) and stuck it into one .d file. No errors! Works as expected. So, WTF?!?! I guess now I have to attempt to split the code across modules to see WTF is going on? Maybe this is a modules issue. I know some of the cod

Re: recursive definition error

2014-07-06 Thread Frustrated via Digitalmars-d-learn
On Friday, 4 July 2014 at 21:15:02 UTC, Frustrated wrote: On Friday, 4 July 2014 at 20:25:28 UTC, Frustrated wrote: On Friday, 4 July 2014 at 16:31:28 UTC, Stanislav Blinov wrote: On Friday, 4 July 2014 at 16:28:48 UTC, Frustrated wrote: On Friday, 4 July 2014 at 15:42:36 UTC, bearophile wrote

Re: [dmd 2.066] Is scope with nothrow regression?

2014-07-06 Thread hane via Digitalmars-d-learn
On Sunday, 6 July 2014 at 22:03:21 UTC, hane wrote: On Sunday, 6 July 2014 at 12:31:42 UTC, NCrashed wrote: ``` void bar() { throw new Exception(""); } void foo() nothrow { scope(failure) {} bar(); } void main() {} ``` Doesn't compile with 2.066: ``` source/app.d(9): E

Re: [dmd 2.066] Is scope with nothrow regression?

2014-07-06 Thread NCrashed via Digitalmars-d-learn
On Sunday, 6 July 2014 at 13:04:35 UTC, Marc Schütz wrote: On Sunday, 6 July 2014 at 12:31:42 UTC, NCrashed wrote: ``` void bar() { throw new Exception(""); } void foo() nothrow { scope(failure) {} bar(); } void main() {} ``` Doesn't compile with 2.066: ``` source/app.

Re: [dmd 2.066] Is scope with nothrow regression?

2014-07-06 Thread hane via Digitalmars-d-learn
On Sunday, 6 July 2014 at 12:31:42 UTC, NCrashed wrote: ``` void bar() { throw new Exception(""); } void foo() nothrow { scope(failure) {} bar(); } void main() {} ``` Doesn't compile with 2.066: ``` source/app.d(9): Error: 'app.bar' is not nothrow source/app.d(6): Error

Re: Visual D: Settings to Improve compil and link process

2014-07-06 Thread Rainer Schuetze via Digitalmars-d-learn
On 06.07.2014 19:51, ParticlePeter wrote: On Sunday, 6 July 2014 at 08:09:07 UTC, Rainer Schuetze wrote: On 05.07.2014 16:05, ParticlePeter wrote: ... It is possible to remove the template methods from my classes, create free functions instead and use them in a UFCS way. Unfortunately I ha

Re: How to test templates for equality?

2014-07-06 Thread Philippe Sigaud via Digitalmars-d-learn
Seeing his example, the OP wants a solution that works even for templates: template Test1(T) {} pragma(msg, instanceArgsOf!(Test1, Test1!int)); which fails because Test1!int is not a type (std.traits.isInstanceOf fails also, for the same reason). And is(symbol == Name!Args, Args...) does not wor

Re: Using a delegate when interfacing with C

2014-07-06 Thread Marco Cosentino via Digitalmars-d-learn
Hey Adam, an interesting aspect of what I'd like to achieve is to use compile-time reflection to generate the wrapper functions for all the delegates (there are ~ 10). The pattern is like what I presented eariler and in addition to that there are some delegates which have no return type (void).

Re: Visual D: Settings to Improve compil and link process

2014-07-06 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 6 July 2014 at 08:09:07 UTC, Rainer Schuetze wrote: On 05.07.2014 16:05, ParticlePeter wrote: ... It is possible to remove the template methods from my classes, create free functions instead and use them in a UFCS way. Unfortunately I have not figured out UFCS properly, as my app

Re: How to test templates for equality?

2014-07-06 Thread Ali Çehreli via Digitalmars-d-learn
On 07/05/2014 10:33 PM, Uranuz wrote: I have another question about testing if given symbol is instance of the given template and geting it's template arguments. Applying Rene Zwanenburg's message... It is not complete because integral template parameters don't work yet. import std.typetuple

Problem building vibe.d in test project

2014-07-06 Thread Nordlöw
I've setup a test project for vibe.d using dub at https://github.com/nordlow/vibe-test but when I type dub It err as follows: [per:/home/per/vibtest] 5s 2 $ dub WARNING: A deprecated branch based version specification is used for the dependency vibe-d. Please use numbered versions in

MmFile.unmap() errs on empty file

2014-07-06 Thread Nordlöw
I just spent two hours tracking down a bug caused by the fact that MmFile's ctor gladly accepts mapping an empty file but its member function unmap() will not. Is this a known issue?

Re: [dmd 2.066] Is scope with nothrow regression?

2014-07-06 Thread via Digitalmars-d-learn
On Sunday, 6 July 2014 at 12:31:42 UTC, NCrashed wrote: ``` void bar() { throw new Exception(""); } void foo() nothrow { scope(failure) {} bar(); } void main() {} ``` Doesn't compile with 2.066: ``` source/app.d(9): Error: 'app.bar' is not nothrow source/app.d(6): Error

[dmd 2.066] Is scope with nothrow regression?

2014-07-06 Thread NCrashed via Digitalmars-d-learn
``` void bar() { throw new Exception(""); } void foo() nothrow { scope(failure) {} bar(); } void main() {} ``` Doesn't compile with 2.066: ``` source/app.d(9): Error: 'app.bar' is not nothrow source/app.d(6): Error: function 'app.foo' is nothrow yet may throw ```

Re: dmd & dub from git master

2014-07-06 Thread w0rp via Digitalmars-d-learn
I hit this myself also. I was trying to use the master branch DMD, druntime, and phobos with a recent vibe.d for building the documentation with ddox, and I ran into the reliance on std.metastrings.

Re: dependency graph

2014-07-06 Thread Rene Zwanenburg via Digitalmars-d-learn
On Saturday, 5 July 2014 at 15:33:51 UTC, Vlad Levenfeld wrote: A colleague of mine had asked me if I could produce some kind of object/module dependency type of graph for a D project I've got. I'm not sure what these are called but I've seen them before for inheritance hierarchies in C++ proje

Re: dmd & dub from git master

2014-07-06 Thread Nordlöw
What is the syntax for specifying a specific package version (in my case ~master) when calling dub init?

Re: dmd & dub from git master

2014-07-06 Thread Nordlöw
On Sunday, 6 July 2014 at 09:54:11 UTC, Nordlöw wrote: I believe I need git master instead of latest release because of https://github.com/rejectedsoftware/vibe.d/commits/master If I change "vibe-d": "~>0.7.19" to "vibe-d": "~master" followed by dub upgrade and dub I ins

dmd & dub from git master

2014-07-06 Thread Nordlöw
Trying to use dub git master with dmd git master fails as[per:/home/per] master(+20/-466) ± dub init vibtest vibe.d Successfully created an empty project in '/home/per/vibtest'. [per:/home/per] master(+20/-466) ± cd vibtest/ /home/per/vibtest [per:/home/per/vibtest] $ dub Fetching vibe-d 0.7.20 (

Re: Problem Linking Phobos git master

2014-07-06 Thread Nordlöw
Do you have an DFLAGS environment variable set on your system? It looks like the environment variable is used instead of the make file variable while compiling. Yep, the DFLAGS parameter was given to the make call. Removing it... Thx!

Re: implib and system dlls, oh my

2014-07-06 Thread Jason King via Digitalmars-d-learn
You may want to spearhead the effort to get Win32 support of MSVC into D, if you care enough about it. Rainer has done most of the work, you'd just have to turn his patches into pull requests, shepherd them through the review process, and maybe add some polish: http://forum.dlang.org/threa

Re: What exactly module in D means?

2014-07-06 Thread Philippe Sigaud via Digitalmars-d-learn
On Sat, Jul 5, 2014 at 6:35 PM, Andre Tampubolon via Digitalmars-d-learn wrote: > I've been reading the newsgroup for a while, and it seems that one of the > reason folks like D is because it supports module. > > My question is: what does module mean? > A quick google pointed my this page: http://

Re: dependency graph

2014-07-06 Thread Philippe Sigaud via Digitalmars-d-learn
If you compile your project with the -deps flag, the compiler will output import dependencies. With -deps=filename, the output will go into filename. >From there, you'll have to parse and create the graph, though. Maybe have a look into rdmd source, to see how the dependency extraction is done the

Re: Visual D: Settings to Improve compil and link process

2014-07-06 Thread Rainer Schuetze via Digitalmars-d-learn
On 05.07.2014 16:05, ParticlePeter wrote: Hello Community, I thought there's a separate forum for VisualD. It did exist when VisualD was on DSource, so why not add it here as well? Or am I to blind to see? The forum digitalmars.D.ide is probably the best fit. Anyway, this thread is an add