Re: WindowsAPI - Problem with DECLARE_HANDLE definition

2013-09-08 Thread Vladimir Panteleev
On Sunday, 8 September 2013 at 23:52:46 UTC, Stewart Gordon wrote: 1. Define a hierarchy of dummy classes for the handle types. No actual objects will exist of these types, but since classes are reference types they can be set to null. But there's a nasty bug lurking in this: if somebody

Re: new DIP47: Outlining member functions of aggregates

2013-09-08 Thread Meta
On Sunday, 8 September 2013 at 03:37:35 UTC, Walter Bright wrote: On the other hand, DRY, and I don't recall anyone ever complaining about this in C++ outlined members. Let me be the first, then, to formally lodge my complaint. As for the DIP itself, I had enough of this tedium in C++. I

Re: WindowsAPI - Problem with DECLARE_HANDLE definition

2013-09-08 Thread Vladimir Panteleev
On Monday, 9 September 2013 at 01:25:00 UTC, Mike Parker wrote: On 9/9/2013 8:52 AM, Stewart Gordon wrote: What do people think we should do? Eliminate declare handle and alias all HANDLE types to void*. I think this is the lazy and shortsighted answer. Even the official Windows headers

Re: new DIP47: Outlining member functions of aggregates

2013-09-08 Thread Manu
Missed the action... Well it's clear this is not a popular proposal. And even to me personally, it's certainly not of critical importance. If there was a single thing I'd like to see *DONE* in D, it would be temporary/r-value-ref args, without question (really, really annoying to work around).

Re: new DIP47: Outlining member functions of aggregates

2013-09-08 Thread Manu
On 9 September 2013 05:46, Andrej Mitrovic andrej.mitrov...@gmail.comwrote: On 9/8/13, Jesse Phillips jesse.k.phillip...@gmail.com wrote: I realize that we want to make it as painless as possible for Remedy to switch from C++ to D (along with the rest of the game developers). FWIW I

Re: new DIP47: Outlining member functions of aggregates

2013-09-08 Thread Peter Williams
On 08/09/13 16:47, Walter Bright wrote: On 9/7/2013 11:08 PM, Peter Williams wrote: In summary, you've gotten rid of the need for this type of duplication so why would you introduce it? I believe that is covered in the Rationale section of the dip. Couldn't see a rational answer to my

Re: new DIP47: Outlining member functions of aggregates

2013-09-08 Thread deadalnix
On Monday, 9 September 2013 at 03:46:23 UTC, Manu wrote: For the record, I tend to agree with the arguments of many in the 'against' camp *from a purist point of view*, but the problem remains, and the reason I raised it; this has demonstrated to me and my colleagues on a number of occasions

Re: Move VisualD to github/d-programming-language ?

2013-09-08 Thread Manu
On 8 September 2013 05:04, Walter Bright newshou...@digitalmars.com wrote: Recent threads here have made it pretty clear that VisualD is a critical piece of D infrastructure. (VisualD integrated D usage into Microsoft Visual Studio.) Andrei, myself and Rainer (VisualD's champion) are all in

Re: Move VisualD to github/d-programming-language ?

2013-09-08 Thread H. S. Teoh
On Mon, Sep 09, 2013 at 02:32:40PM +1000, Manu wrote: On 8 September 2013 05:04, Walter Bright newshou...@digitalmars.com wrote: Recent threads here have made it pretty clear that VisualD is a critical piece of D infrastructure. (VisualD integrated D usage into Microsoft Visual Studio.)

Re: Move VisualD to github/d-programming-language ?

2013-09-08 Thread Manu
On 9 September 2013 14:32, Manu turkey...@gmail.com wrote: On 8 September 2013 05:04, Walter Bright newshou...@digitalmars.comwrote: Recent threads here have made it pretty clear that VisualD is a critical piece of D infrastructure. (VisualD integrated D usage into Microsoft Visual Studio.)

Re: Move VisualD to github/d-programming-language ?

2013-09-08 Thread Andrei Alexandrescu
On 9/8/13 9:32 PM, Manu wrote: On 8 September 2013 05:04, Walter Bright newshou...@digitalmars.com mailto:newshou...@digitalmars.com wrote: Recent threads here have made it pretty clear that VisualD is a critical piece of D infrastructure. (VisualD integrated D usage into Microsoft

Re: new DIP47: Outlining member functions of aggregates

2013-09-08 Thread FrogLegs
This seems like a waste of time compared to the other complaints Manu brought up(bad IDE/debugger support etc.)

Re: Move VisualD to github/d-programming-language ?

2013-09-08 Thread Volcz
Good idea! What about other useful projects? I know that a official lexer was discussed some time ago. What about DCD? Should ex VisualD use software like DCD if both are on the dlang GitHub? Should we make pull requests/empty repos. for other nice to have software?

Re: Move VisualD to github/d-programming-language ?

2013-09-08 Thread Jonathan M Davis
On Monday, September 09, 2013 07:41:44 Volcz wrote: Good idea! What about other useful projects? I know that a official lexer was discussed some time ago. What about DCD? Should ex VisualD use software like DCD if both are on the dlang GitHub? The plan is to integrate a full lexer and

Re: Do constructors in D support the privacy keyword?

2013-09-08 Thread Michael
In same module private acts like friend in C++.

SpawnProcess fails when console is hidden

2013-09-08 Thread Nemo
Hi, I have win32 program, which takes command line parameters and passes them trough socket to another program, running on the same machine. If connection fails, it needs to start the another program. I don't want console to popup so I added -L/SUBSYSTEM:WINDOWS. This works fine, except

Re: Bug with multiple subtyping?

2013-09-08 Thread Joseph Rushton Wakeling
On 07/09/13 16:10, Joseph Rushton Wakeling wrote: TDPL gives a description in Section 6.13 (pp. 230-233) of a method for subtyping by storing a private instance of the base type and using alias ... this to access its methods. The example given is as follows: No one has confirmed yea or nay on

Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Gary Willoughby
When iterating through class members using traits how do you filter out the member vars to only get a list of methods. I think i've solved it in the code below but it feels like i am abusing MemberFunctionsTuple. Is this the correct way to do this? private template Methods(T, int index = 0) {

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Dicebot
Key part here is is(T == function) - because of D type system funny properties only possible way to get T that matches that condition is to do `typeof` from declared function/method symbol. That type can't be manually expressed and thus used for member variable.

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Dicebot
http://dpaste.dzfl.pl/c250e798 import std.traits, std.range; private template Methods(T) if (is(T == class)) { private string[] getMethods() { string result[]; foreach (member_string; __traits(allMembers, T))

Re: SpawnProcess fails when console is hidden

2013-09-08 Thread Adam D. Ruppe
My guess, just looking at it, is that spawnProcess fails because there's no streams available for stdin, stdout, and stderr. It tries to reuse the ones of the parent process, but without a console they don't work. It might help to use Config.suppressConsole.. I'm just guessing but maybe

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Gary Willoughby
On Sunday, 8 September 2013 at 13:46:26 UTC, Dicebot wrote: http://dpaste.dzfl.pl/c250e798 import std.traits, std.range; private template Methods(T) if (is(T == class)) { private string[] getMethods() { string result[];

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Dicebot
On Sunday, 8 September 2013 at 16:43:16 UTC, Gary Willoughby wrote: This looks like a nice solution but i get errors when used across modules. The problem is that allmembers emits private members so across modules they are not available. You want to list private members or want them ignored

Re: SpawnProcess fails when console is hidden

2013-09-08 Thread Nemo
Thank you, Config.suppressConsole did not help, but redirecting the std:s did.

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Gary Willoughby
On Sunday, 8 September 2013 at 17:07:57 UTC, Dicebot wrote: On Sunday, 8 September 2013 at 16:43:16 UTC, Gary Willoughby wrote: This looks like a nice solution but i get errors when used across modules. The problem is that allmembers emits private members so across modules they are not

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Adam D. Ruppe
Something along the lines of static if(__traits(compiles, __traits(getMember, Foo, member)) static if(is(__traits(getMember, Foo, member) == function)) { // use it } The __traits(compiles, ...) is my go-to thingy for filtering out random errors.

Re: Non-covariance and overrides

2013-09-08 Thread Jacob Carlborg
On 2013-09-07 13:42, Joseph Rushton Wakeling wrote: On 03/09/13 08:56, Jacob Carlborg wrote: class MyFakeSubclass { MyBaseClass base alias base this; } Every method not available in MyFakeSubclass will be forwarded to base. http://dlang.org/class.html#AliasThis OK, but the

Re: Bug with multiple subtyping?

2013-09-08 Thread Jacob Carlborg
On 2013-09-07 16:10, Joseph Rushton Wakeling wrote: Hello all, TDPL gives a description in Section 6.13 (pp. 230-233) of a method for subtyping by storing a private instance of the base type and using alias ... this to access its methods. The example given is as follows: class StorableShape :

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Jacob Carlborg
On 2013-09-08 18:43, Gary Willoughby wrote: This looks like a nice solution but i get errors when used across modules. The problem is that allmembers emits private members so across modules they are not available. I'm wondering if it tries to call the method here: static if

Re: Bug with multiple subtyping?

2013-09-08 Thread Joseph Rushton Wakeling
On 08/09/13 21:44, Jacob Carlborg wrote: Try using opDispatch as a described in the other thread. I'll give that a go, but I still think this is a bug that needs fixing. The example in TDPL p. 231 will very clearly also not work due to this issue.

Re: Using traits get a list of methods and filter out the member vars.

2013-09-08 Thread Dicebot
On Sunday, 8 September 2013 at 19:48:31 UTC, Jacob Carlborg wrote: I'm wondering if it tries to call the method here: static if (is(typeof(member) == function)) Since D allows to call methods without parentheses. No, not in typeof. It will try to call it with `member.stringof` though, thus

Limited type matching?

2013-09-08 Thread Namespace
Code: import std.stdio; void foo(short x, short y) { } void foo(short[2] xy) { } void main() { foo(1, 2); /// works foo([1, 2]); /// works ushort[2] xy = [1, 2]; foo(xy); /// fails ushort x = 1, y = 2; foo(x, y); /// works

Re: nothrow function to tell if a string can be converted to a number?

2013-09-08 Thread Timothee Cour
On Fri, Sep 6, 2013 at 9:38 PM, Jonathan M Davis jmdavisp...@gmx.comwrote: On Friday, September 06, 2013 21:15:44 Timothee Cour wrote: I'd like to have a function: @nothrow bool isNumberLitteral(string a); unittest{ assert(isNumberLitteral(1.2)); assert(!isNumberLitteral(a1.2));

Re: nothrow function to tell if a string can be converted to a number?

2013-09-08 Thread Timothee Cour
sorry I was a bit sloppy in my previous post. Here it is corrected: I was also curious whether there's functionality for the following (I wrote my own versions but they might not consider all cases) bool isStringLitteral(string); //tests whether a string represents a string litteral unittest{

[Issue 10991] Implement trait to get vptr index of a method.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10991 Kapps opantm2+db...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #1

[Issue 10992] New: Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Summary: Trait getUnitTests skips first test if aggregate contains multiple tests. Product: D Version: D2 Platform: All OS/Version: All Status: NEW

[Issue 1878] foreach does not handle integral types appropriately

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1878 Lionello Lunesu lio+bugzi...@lunesu.com changed: What|Removed |Added CC|

[Issue 10993] New: mangling of voldemort types with lambdas changes during return type inference

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10993 Summary: mangling of voldemort types with lambdas changes during return type inference Product: D Version: D2 Platform: All OS/Version: All Status: NEW

[Issue 10994] New: [REG] cannot declare statics struct with void-initialized static arrays

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10994 Summary: [REG] cannot declare statics struct with void-initialized static arrays Product: D Version: D2 Platform: All OS/Version: All Status: NEW

[Issue 1878] foreach does not handle integral types appropriately

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1878 --- Comment #4 from Lionello Lunesu lio+bugzi...@lunesu.com 2013-09-08 02:14:15 PDT --- I checked the difference between CondExp (?:) and ForeachRangeStatement. The former only has a special case when the types of the two expressions are

[Issue 10968] array element copy (1-N and N-N) ignores postblit attributes

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10968 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 10995] New: [REG]CTFE failures for structs with void initialized members

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10995 Summary: [REG]CTFE failures for structs with void initialized members Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity:

[Issue 6178] Struct inside the AA are not init correctly

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6178 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull, wrong-code

[Issue 10996] Subtyping with alias this conflicts with private base type

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10996 --- Comment #1 from Joseph Rushton Wakeling joseph.wakel...@webdrake.net 2013-09-08 04:47:10 PDT --- Created an attachment (id=1247) Main program file that imports the subtype module. Run to see the bug in action. -- Configure issuemail:

[Issue 10996] New: Subtyping with alias this conflicts with private base type

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10996 Summary: Subtyping with alias this conflicts with private base type Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal

[Issue 9384] std.socket: UnixAddress broken on Linux and others

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9384 jerro.pub...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 10985] Inliner doesn't attempt to inline non-templated functions from libraries (even having the full source)

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10985 --- Comment #3 from Dmitry Olshansky dmitry.o...@gmail.com 2013-09-08 07:48:59 PDT --- (In reply to comment #1) I suspect this is a regression, but haven't yet made the time to try some older releases. What's horrible is that the same

[Issue 10913] [2.064 git-head] regex/demange compilation failure

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10913 --- Comment #5 from github-bugzi...@puremagic.com 2013-09-08 08:39:14 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/phobos

[Issue 10893] Numerous DDoc parameter warnings in Phobos (as found by 10236)

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10893 --- Comment #3 from github-bugzi...@puremagic.com 2013-09-08 08:37:24 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/phobos

[Issue 10913] [2.064 git-head] regex/demange compilation failure

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10913 Dmitry Olshansky dmitry.o...@gmail.com changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 10997] New: Tupple parsing(?)

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10997 Summary: Tupple parsing(?) Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: DMD

[Issue 10985] Inliner doesn't attempt to inline non-templated functions from libraries (even having the full source)

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10985 --- Comment #4 from Brad Roberts bra...@puremagic.com 2013-09-08 10:28:43 PDT --- Neither GDC nor LDC rely on the frontend inliner. To make sure the code is or isn't inlined properly, you really need to check the resulting generated code.

[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Jacob Carlborg d...@me.com changed: What|Removed |Added CC||d...@me.com --- Comment

[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added CC|

[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992 --- Comment #3 from Jacob Carlborg d...@me.com 2013-09-08 13:03:37 PDT --- I still cannot reproduce it: $ ./dmd -unittest -run main.d Test 1 Test 2 Test 3 main Test 1 Test 2 Test 3 Commit fc460eede168cf52879ca41191baf7db1f893569 on Mac OS X.

[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992 --- Comment #4 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-09-08 13:07:02 PDT --- (In reply to comment #3) Commit fc460eede168cf52879ca41191baf7db1f893569 on Mac OS X. (In reply to comment #3) I still cannot reproduce it: $

[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992 --- Comment #5 from Kapps opantm2+db...@gmail.com 2013-09-08 13:14:40 PDT --- (In reply to comment #4) Hmm, maybe it's a platform-specific issue. I could look into it if you don't have a win32 system around. I'm running Linux 64-bit and

[Issue 10985] Compiler doesn't attempt to inline non-templated functions from libraries (even having the full source)

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10985 Dmitry Olshansky dmitry.o...@gmail.com changed: What|Removed |Added Summary|Inliner doesn't attempt to |Compiler

[Issue 10965] Allow alias initializer as enum member to avoid counter reset

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10965 Henning Pohl henn...@still-hidden.de changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 10988] Add documentation on how to load DLLs at runtime

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10988 Martin Nowak c...@dawg.eu changed: What|Removed |Added Keywords||dll CC|

<    1   2