Re: Why assert is in the language?

2010-06-23 Thread Lutger
Ellery Newcomer wrote: On 06/22/2010 05:36 PM, Ali Çehreli wrote: Jonathan M Davis wrote: Steven Schveighoffer wrote: all calls to assert are removed by the compiler in release mode. I don't think there's a way to implement that via a library (it would be nice though!) Also

Re: Cannot initialize associative array.

2010-06-23 Thread Ali Çehreli
Ali Çehreli wrote: dcoder wrote: So, I moved the initialization to inside the main function, and now it works. Great. I think we need to put this question in the FAQ. For future reference, if it really needs to be global: uint[string] mywords; static this() { mywords = [ Hello :

Re: Cannot initialize associative array.

2010-06-23 Thread Pelle
On 06/23/2010 09:41 AM, Ali Çehreli wrote: Ali Çehreli wrote: dcoder wrote: So, I moved the initialization to inside the main function, and now it works. Great. I think we need to put this question in the FAQ. For future reference, if it really needs to be global: uint[string] mywords;

Re: Cannot initialize associative array.

2010-06-23 Thread bearophile
Ali Çehreli: Could someone please verify whether the above is really necessary? An initialization inside some runtime function/initializator is necessary unless the AA is an enum. Is it actually a dmd bug that we need to use 'static this()' to initialize an associative array? According

Re: Cannot initialize associative array.

2010-06-23 Thread Bernard Helyer
On Wed, 23 Jun 2010 00:41:45 -0700, Ali Çehreli wrote: Ali Çehreli wrote: dcoder wrote: So, I moved the initialization to inside the main function, and now it works. Great. I think we need to put this question in the FAQ. For future reference, if it really needs to be global:

Re: Forking problems on OS X 2.047

2010-06-23 Thread soul8o8
Correction: Of course, you shouldn't call thread_attachThis() for the parent thread. It's already been attached since the D runtime created it. (In fact, the documentation says: If [thread_attachThis()] is called for a thread which is already registered, the result is undefined. My bad.) BR

Re: Cannot initialize associative array.

2010-06-23 Thread Rory McGuire
On Wed, 23 Jun 2010 00:30:40 +0200, Ali Çehreli acehr...@yahoo.com wrote: dcoder wrote: So, I moved the initialization to inside the main function, and now it works. Great. I think we need to put this question in the FAQ. For future reference, if it really needs to be global:

Re: Forking problems on OS X 2.047

2010-06-23 Thread soul8o8
I get the same error. Fix: The following code works allright on MacOS X 10.6.4 / DMD v2.047: module fork; import core.sys.posix.unistd, core.thread,// added std.stdio; void main() { auto pid = fork(); if( pid 0 ) { thread_attachThis();//

Re: Best way to make Until! into string

2010-06-23 Thread div0
On 22/06/2010 23:05, Jonathan M Davis wrote: Oh my, you caveman! ;) I'd have to go look at all of the changelogs to even have a clue of what's been changed since then. Oh well, I guess that it means that you don't have to worry about stuff changing on you each upgrade by sticking to the same

linker error with timeval static-array

2010-06-23 Thread Chick Corea
Using v2.0.47, I get a linker error during compilation w/ the following code. import time = core.sys.posix.sys.time; int main( string[] argv ) { time.timeval x[4];// the static array of timevals is the problem

Re: Why assert is in the language?

2010-06-23 Thread Tomek Sowiński
Dnia 22-06-2010 o 23:55:29 Michal Minich michal.min...@gmail.com napisał(a): On Tue, 22 Jun 2010 17:30:23 -0400, Steven Schveighoffer wrote: On Tue, 22 Jun 2010 17:07:02 -0400, Tomek Sowiński j...@ask.me wrote: Yes, why? It could be implemented in object.d in a similar fashion as

Re: Best way to make Until! into string

2010-06-23 Thread bearophile
div0: and now with 2.047 I've been bitten by the removal of struct initialisers. What do you mean? Bye, bearophile

Multiple Alias this declarations?

2010-06-23 Thread JRM
On page 231, TDPL states that a class can introduce any number of alias this declarations. http://www.digitalmars.com/d/2.0/class.html#AliasThis states that there is only one allowed per class. A quick test shows that dmd agrees with the latter. Which one is right?

Re: Best way to make Until! into string

2010-06-23 Thread Jonathan M Davis
Jonathan M Davis wrote: div0 wrote: [... snip of UTF-8 stuff ...] The UTF char stuff is all painfully complicated, and I _think_ that I more or less understand it, but I suspect that I don't understand it all that well. It would be nice if the there were a page in the docs somewhere