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

2014-05-10 Thread Philippe Sigaud via Digitalmars-d-learn
Vlad Levenfeld: but beware I've noticed that sometimes this is not equivalent to the previous version and I'm not sure how or why that happens. In particular I notice that mixin(const bool value = ~expr~;)); and const bool value = mixin(expr); are not the same, for some reason. What

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

2014-05-10 Thread Vlad Levenfeld via Digitalmars-d-learn
because this works: foreach (type; mixin(`__traits (getAttributes, T.`~member~`)`)) static if (is (type == attribute)) return true;

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

2014-05-10 Thread Vlad Levenfeld via Digitalmars-d-learn
I'm not really sure. Here is an example of the problem: const bool has_attribute (T, string member, alias attribute) () { static if (1) // ok mixin( `foreach (type; __traits (getAttributes, T.`~member~`))` `static if (is (type == attribute))` `return true;` );

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

2014-05-10 Thread Vlad Levenfeld via Digitalmars-d-learn
I don't have any examples of the const bool thing not working, its just something I feel like I recall, though I could be mistaking it for the __traits example.

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-10 Thread FrankLike via Digitalmars-d-learn
I've been using VisualD for a long time without problems. If it makes you nervous, you can get the source from Github and compile it yourself. Hello,Meta When I compile the Visual D projects: at first,I compile the 'build' project,then get some error: --START ALL BUILD: PROJECT: c2d,

Re: Recommendation on option parsing

2014-05-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-05-10 01:09, Chris Piker wrote: Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. Does anyone have a recommendation on which of the existing command line option parsing libraries floating around in the wild to use? If it

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

2014-05-10 Thread Philippe Sigaud via Digitalmars-d-learn
else // doesn't compile, member is not accessible error foreach (type; __traits (getAttributes, mixin(`T.`~member))) static if (is (type == attribute)) return true; return false; Maybe its trying to use it inside of __traits that is causing it? Maybe __traits is

Inspecting lambda parameters

2014-05-10 Thread Jacob Carlborg via Digitalmars-d-learn
I know that there are templates to inspect function parameters, like ParameterIdentifierTuple and ParameterTypeTuple. But these don't work for templated/untyped lambdas, they're apparently not callables. I don't expect ParameterTypeTuple to work, but it would be nice if

Re: Recommendation on option parsing

2014-05-10 Thread Robert Schadek via Digitalmars-d-learn
On 05/10/2014 01:09 AM, Chris Piker via Digitalmars-d-learn wrote: Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. Does anyone have a recommendation on which of the existing command line option parsing libraries floating around

Curl Exception

2014-05-10 Thread Jack via Digitalmars-d-learn
First off a rant: I use the Code::Blocks IDE and at times it has been proven to a double-edged source because of various issueslike this one: http://forum.dlang.org/thread/ndeyzrifseipuebvy...@forum.dlang.org) and am now itching to search for other IDEs to suit my needs. Now on to the

Re: Curl Exception

2014-05-10 Thread Jack via Digitalmars-d-learn
On Saturday, 10 May 2014 at 13:02:39 UTC, Jack wrote: First off a rant: I use the Code::Blocks IDE and at times it has been proven to a double-edged source because of various issueslike this one: http://forum.dlang.org/thread/ndeyzrifseipuebvy...@forum.dlang.org) and am now itching to

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

2014-05-10 Thread Vlad Levenfeld via Digitalmars-d-learn
Agreed, new bug report submitted.

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-10 Thread Meta via Digitalmars-d-learn
On Saturday, 10 May 2014 at 08:42:14 UTC, FrankLike wrote: I've been using VisualD for a long time without problems. If it makes you nervous, you can get the source from Github and compile it yourself. Hello,Meta When I compile the Visual D projects: at first,I compile the 'build'

Re: Inspecting lambda parameters

2014-05-10 Thread Meta via Digitalmars-d-learn
On Saturday, 10 May 2014 at 10:56:57 UTC, Jacob Carlborg wrote: I know that there are templates to inspect function parameters, like ParameterIdentifierTuple and ParameterTypeTuple. But these don't work for templated/untyped lambdas, they're apparently not callables. I don't expect

Re: Inspecting lambda parameters

2014-05-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-05-10 18:56, Meta wrote: Wasn't there recently a pull request to add TemplateArgsOf, or something like that. There's this pull request [1] that adds a couple of new traits that might help. Also, if you know what type the lambda is going to be instantiated with, you can turn it

Temporary silence output (stdout)

2014-05-10 Thread MarisaLovesUsAll via Digitalmars-d-learn
Hi! I sometimes got a useless messages in stdout from SDL_Image library, and I want to temporary silence it. How do I do?

Re: Temporary silence output (stdout)

2014-05-10 Thread Mark Isaacson via Digitalmars-d-learn
On Saturday, 10 May 2014 at 20:24:50 UTC, MarisaLovesUsAll wrote: Hi! I sometimes got a useless messages in stdout from SDL_Image library, and I want to temporary silence it. How do I do? Consider using either version or debug statements. If you want the messages to be opt-in, debug

Re: Temporary silence output (stdout)

2014-05-10 Thread Artur Skawina via Digitalmars-d-learn
On 05/10/14 22:24, MarisaLovesUsAll via Digitalmars-d-learn wrote: I sometimes got a useless messages in stdout from SDL_Image library, and I want to temporary silence it. How do I do? One way would be something like: import std.stdio; void writeOutput () { static c = 1;

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-10 Thread FrankLike via Digitalmars-d-learn
You have spaces in your path, which is not good. Put quotes around the file paths, like so: VSSDK100Install = C:\Program Files (x86)\Microsoft Visual Studio 2010 SDK SP1 WindowsSdkDir = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A Thank you.

Re: core.sync.rwmutex example

2014-05-10 Thread TheFlyingFiddle via Digitalmars-d-learn
On Friday, 9 May 2014 at 23:12:44 UTC, Charles Hixson via Digitalmars-d-learn wrote: But I'm worried about the receiving end. It needs, somehow, to ensure that the message it receives is the appropriate message, and that other messages don't get dropped while it's waiting for the

Configuring Phobos from the 1-click installer

2014-05-10 Thread Moses via Digitalmars-d-learn
After using the 1-click Ubuntu installer, I'm having trouble figuring out how to import standard library functions for Phobos. I get the message: Error: module io is in file 'std/std/io.d' which cannot be read import path[0] = /usr/include/dmd/phobos import path[1] =

Messy code in console

2014-05-10 Thread IceNature via Digitalmars-d-learn
When there are Chinese characters in the output, the console will display messy code.I change the encoding of the source file into UTF-8 or UTF-16,but the messy code is still there... I use the dmd 2.065,Visual Studio 2013 with VisualD. How to solve this problem?

Re: Messy code in console

2014-05-10 Thread Ali Çehreli via Digitalmars-d-learn
On 05/10/2014 07:19 PM, IceNature via Digitalmars-d-learn wrote: When there are Chinese characters in the output, the console will display messy code.I change the encoding of the source file into UTF-8 or UTF-16,but the messy code is still there... I use the dmd

Re: Configuring Phobos from the 1-click installer

2014-05-10 Thread Ali Çehreli via Digitalmars-d-learn
On 05/10/2014 07:12 PM, Moses wrote: After using the 1-click Ubuntu installer, I'm having trouble figuring out how to import standard library functions for Phobos. I get the message: Error: module io is in file 'std/std/io.d' which cannot be read Judging from the repeated stds up there I

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-10 Thread FrankLike via Digitalmars-d-learn
You have spaces in your path, which is not good. Put quotes around the file paths, like so: VSSDK100Install = C:\Program Files (x86)\Microsoft Visual Studio 2010 SDK SP1 WindowsSdkDir = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A Sorry,Meta, the problem still exists,but I compile

Re: Messy code in console

2014-05-10 Thread FrankLike via Digitalmars-d-learn
On Sunday, 11 May 2014 at 02:38:44 UTC, IceNature via Digitalmars-d-learn wrote: When there are Chinese characters in the output, the console will display messy code.I change the encoding of the source file into UTF-8 or UTF-16,but the messy code is still there... I use the

Re: Configuring Phobos from the 1-click installer

2014-05-10 Thread Moses via Digitalmars-d-learn
On Sunday, 11 May 2014 at 04:33:24 UTC, Ali Çehreli wrote: On 05/10/2014 07:12 PM, Moses wrote: After using the 1-click Ubuntu installer, I'm having trouble figuring out how to import standard library functions for Phobos. I get the message: Error: module io is in file 'std/std/io.d' which