Re: Empty const strings result in linker errors.

2011-05-29 Thread Jacob Carlborg
On 2011-05-29 22:28, Nick Sabalausky wrote: "Jacob Carlborg" wrote in message news:iru404$4qp$1...@digitalmars.com... In DMD 1.068 I get linker errors, missing symbols, on empty strings that are const. Is this a bug or intentional? It's an already-reported bug in D1: http://d.puremagic.com/i

Re: Mutually exclusive switches in getopt?

2011-05-29 Thread Jonathan M Davis
On 2011-05-29 21:43, Andrej Mitrovic wrote: > I don't see this option in getopt, is it there? > > e.g. If I want to disallow passing "--loud" and "--quite" at the same time. > I can understand it would be difficult to implement this with getopt's > current API. > > A limited form of this is possi

Mutually exclusive switches in getopt?

2011-05-29 Thread Andrej Mitrovic
I don't see this option in getopt, is it there? e.g. If I want to disallow passing "--loud" and "--quite" at the same time. I can understand it would be difficult to implement this with getopt's current API. A limited form of this is possible to do inline via a delegate. For example: bool quie

Re: github: What to do when unittests fail?

2011-05-29 Thread Don
Dmitry Olshansky wrote: On 24.05.2011 1:33, Andrej Mitrovic wrote: I've cloned Phobos just a few minutes ago, and I've tried to build it with unittests, I'm getting these: Warning: AutoImplement!(C_6) ignored variadic arguments to the constructor C_6(...) --- std.socket(316) broken test --

Linking with/Debugging static C/C++ libraries

2011-05-29 Thread Jeff Slutter
I'm just starting out in my journey of R&D/evaluation of using D, as a possible future development platform, for my team at work. I like a lot of what I see! Currently we do all our development in Visual Studio, using C/C++ (and C# for some tools), and it is definitely the 'comfort zone' for the t

Re: listener.d: Range violation.

2011-05-29 Thread Jesse Brands
That worked, thanks a lot! I was going nuts as to why it wouldn't work! Much loves to you!

Re: listener.d: Range violation.

2011-05-29 Thread Dmitry Olshansky
On 30.05.2011 0:38, Jesse Brands wrote: Hello there, For a small chat server thingie I'm making, I decided to use D; finding myself with a very neat example from listener.d to get a kick start I decided to pretty much take the example over! However, I'm stuck on a bug I can't truly wrap my finge

listener.d: Range violation.

2011-05-29 Thread Jesse Brands
Hello there, For a small chat server thingie I'm making, I decided to use D; finding myself with a very neat example from listener.d to get a kick start I decided to pretty much take the example over! However, I'm stuck on a bug I can't truly wrap my finger around. Most likely it's my own fault an

Re: Empty const strings result in linker errors.

2011-05-29 Thread Nick Sabalausky
"Jacob Carlborg" wrote in message news:iru404$4qp$1...@digitalmars.com... > In DMD 1.068 I get linker errors, missing symbols, on empty strings that > are const. Is this a bug or intentional? > It's an already-reported bug in D1: http://d.puremagic.com/issues/show_bug.cgi?id=4315

Re: Compile time static array issues.

2011-05-29 Thread Andrej Mitrovic
On 5/29/11, bearophile wrote: > Andrej Mitrovic: > >> C struct initialization in D is also buggy, it doesn't take into >> account field initializers. It's best to get used to the D way of >> initializing structs. > > I'd like it to be debugged instead :-) Well if it has already been decided that

Re: Compile time static array issues.

2011-05-29 Thread bearophile
Andrej Mitrovic: > C struct initialization in D is also buggy, it doesn't take into > account field initializers. It's best to get used to the D way of > initializing structs. I'd like it to be debugged instead :-) Bye, bearophile

Re: Compile time static array issues.

2011-05-29 Thread Andrej Mitrovic
C struct initialization in D is also buggy, it doesn't take into account field initializers. It's best to get used to the D way of initializing structs.

Empty const strings result in linker errors.

2011-05-29 Thread Jacob Carlborg
In DMD 1.068 I get linker errors, missing symbols, on empty strings that are const. Is this a bug or intentional? -- /Jacob Carlborg

__gshared & class instances

2011-05-29 Thread Nrgyzer
Hi everyone, I'm having some trouble by using threads. I've 3 classes: class MainClass { ... __gshared { TimedCallback callback; SecondClass instance; } void callbackMethod() {...} void load() { // loads something... and do: instance = new SecondClass();

Re: Compile time static array issues.

2011-05-29 Thread Jacob Carlborg
On 2011-05-29 15:01, bearophile wrote: Jacob Carlborg: Isn't that struct initialization syntax deprecated or to be deprecated? You may be right. Sometimes I read about deprecations, and then after a while I forget it because the alternative (like using the complex numbers of Phobos) is too

Re: Assert allowed to have side effects?

2011-05-29 Thread simendsjo
On 29.05.2011 15:03, bearophile wrote: In D there are pure functions, so I think it's not too much hard for it to tell apart when the contents of an assert() are pure or not. My opinion is that the D compiler has to enforce purity inside assert(), to avoid bugs. http://d.puremagic.com/issues/

Re: Assert allowed to have side effects?

2011-05-29 Thread bearophile
Stewart Gordon: > There are places where the spec fails to make a clear distinction between > illegal code and > incorrect code that the compiler may reject if it's smart enough. In D there are pure functions, so I think it's not too much hard for it to tell apart when the contents of an asser

Re: Compile time static array issues.

2011-05-29 Thread bearophile
Jacob Carlborg: > Isn't that struct initialization syntax deprecated or to be deprecated? You may be right. Sometimes I read about deprecations, and then after a while I forget it because the alternative (like using the complex numbers of Phobos) is too much ugly by comparison :-) I think we n

Re: Assert allowed to have side effects?

2011-05-29 Thread Stewart Gordon
On 29/05/2011 09:44, simendsjo wrote: The documentation for assert, http://www.digitalmars.com/d/2.0/expression.html#AssertExpression, states that it's an error if the assert expression contains side effects, but it doesn't seem the compiler is enforcing this. There are places where the spec

Re: Compile time static array issues.

2011-05-29 Thread Jacob Carlborg
On 2011-05-29 03:56, bearophile wrote: Era Scarecrow: I don't seem to have a good explanation why this isn't working. Also try: struct Joined { string name, partof, preReq; } struct SubrecordParts { string name; int size; string[] notes; int identifyBy; int[]

Assert allowed to have side effects?

2011-05-29 Thread simendsjo
The documentation for assert, http://www.digitalmars.com/d/2.0/expression.html#AssertExpression, states that it's an error if the assert expression contains side effects, but it doesn't seem the compiler is enforcing this. module assert_sideeffect; bool b; bool f() { b = !b; return b; } void m

Re: Compile time static array issues.

2011-05-29 Thread Era Scarecrow
== Quote from bearophile (bearophileh...@lycos.com)'s article > Also try: > struct Joined { > string name, partof, preReq; > } > Joined[] attached = [ > {"MAST", "DATA", "TES3"}, > {"ANAM","INTV", "FACT"} > ]; Coming from C, this is exactly what I first tried. However since I don't r