Re: Why is a static struct's dtor called at the exit of a function?

2011-07-22 Thread Diego Canuhé
Hi, I'm not really an experienced programmer so I might be missing something but... in http://d-programming-language.org/attribute.html static is described as follows: The static attribute applies to functions and data. It means that the declaration does not apply to a particular instance of an

Need OMF MySQL lib that actually f^*^ works...

2011-07-22 Thread Nick Sabalausky
Anyone have a known-working Windows OMF library for MySQL? Static or dynamic, I don't care. I've tried fucking everything and I can't get the dang thing to work. Static was a total no-go. With dynamic, using implib I got it to link, but calling any of it resulted in an Access Violation. Using

Re: Why is a static struct's dtor called at the exit of a function?

2011-07-22 Thread Jonathan M Davis
On Friday 22 July 2011 03:12:00 Diego Canuhé wrote: Hi, I'm not really an experienced programmer so I might be missing something but... in http://d-programming-language.org/attribute.html static is described as follows: The static attribute applies to functions and data. It means that

Re: Why is a static struct's dtor called at the exit of a function?

2011-07-22 Thread Jacob Carlborg
On 2011-07-22 08:12, Diego Canuhé wrote: Hi, I'm not really an experienced programmer so I might be missing something but... in http://d-programming-language.org/attribute.html static is described as follows: The static attribute applies to functions and data. It means that the declaration

Re: Why is a static struct's dtor called at the exit of a function?

2011-07-22 Thread Diego Canuhé
thanks ;)

Re: How to get stack trace on Windows?

2011-07-22 Thread Dmitry Olshansky
On 22.07.2011 6:54, Nick Sabalausky wrote: I'm not getting any of the function names on the stack traces. I tried everything I found in here: http://www.digitalmars.com/d/archives/digitalmars/D/Windows_Stack_Traces_Function_Names_136887.html - I installed the Debugging Tools for Windows to

Re: Small problem with multi-line strings

2011-07-22 Thread Dmitry Olshansky
On 22.07.2011 3:18, bearophile wrote: Multi-line strings are handy, but I have a small problem. This is an example, it has a problem, there is an unwanted newline at the beginning: writeln( - First item: 150 - Second item: 200 - Third item: 105); To avoid it you can write this, but both

Re: Small problem with multi-line strings

2011-07-22 Thread bearophile
Dmitry Olshansky: writeln( - First item: 150\n - Second item: 200\n - Third item: 105); Yeah, I know implicit concatenation is bad and I would agree once ~ concatenate complie-time string for 0 overhead. This works, but it's noisy. Multi-line strings are present in D right to avoid

Re: How to get stack trace on Windows?

2011-07-22 Thread Nick Sabalausky
Dmitry Olshansky dmitry.o...@gmail.com wrote in message news:j0bgt7$176q$1...@digitalmars.com... On 22.07.2011 6:54, Nick Sabalausky wrote: I'm not getting any of the function names on the stack traces. I tried everything I found in here:

Re: How to get stack trace on Windows?

2011-07-22 Thread Dmitry Olshansky
On 22.07.2011 15:02, Nick Sabalausky wrote: Dmitry Olshanskydmitry.o...@gmail.com wrote in message news:j0bgt7$176q$1...@digitalmars.com... On 22.07.2011 6:54, Nick Sabalausky wrote: I'm not getting any of the function names on the stack traces. I tried everything I found in here:

Reference counting questions

2011-07-22 Thread Johannes Pfau
I have some problems understanding the reference counting code in std.stdio. The reduced code my questions refer to is here: https://gist.github.com/1099229 (ignore the not-working struct default constructor, that's just to simplify the code) in line 5: why is 'refs' initialized to 'uint.max /

Re: Why is a static struct's dtor called at the exit of a function?

2011-07-22 Thread Steven Schveighoffer
On Fri, 22 Jul 2011 02:57:38 -0400, Diego Canuhé canuh...@gmail.com wrote: thanks ;) Don't feel bad, static is probably the most abused keyword in D and C++. It has about 3 or 4 meanings depending on context. -Steve

Re: does the x64 compiler for linux make x64 executables?

2011-07-22 Thread Jesse Phillips
McAnany, Charles E Wrote: Hi, all. So I see that there is an Ubuntu dmd that has x86_64 as the CPU column. Before I install Ubuntu to great disappointment, does this mean that I get a 64 bit executable, or does it just mean that the compiler itself is a 64 bit application? Thanks,

Re: Need OMF MySQL lib that actually f^*^ works...

2011-07-22 Thread Robert Clipsham
On 22/07/2011 07:20, Nick Sabalausky wrote: Anyone have a known-working Windows OMF library for MySQL? Static or dynamic, I don't care. I've tried fucking everything and I can't get the dang thing to work. Static was a total no-go. With dynamic, using implib I got it to link, but calling any of

Re: Need OMF MySQL lib that actually f^*^ works...

2011-07-22 Thread Nick Sabalausky
Robert Clipsham rob...@octarineparrot.com wrote in message news:j0ce0t$2rte$1...@digitalmars.com... On 22/07/2011 07:20, Nick Sabalausky wrote: Anyone have a known-working Windows OMF library for MySQL? Static or dynamic, I don't care. I've tried fucking everything and I can't get the dang

Re: Need OMF MySQL lib that actually f^*^ works...

2011-07-22 Thread Dmitry Olshansky
On 22.07.2011 23:06, Nick Sabalausky wrote: Robert Clipshamrob...@octarineparrot.com wrote in message news:j0ce0t$2rte$1...@digitalmars.com... On 22/07/2011 07:20, Nick Sabalausky wrote: Anyone have a known-working Windows OMF library for MySQL? Static or dynamic, I don't care. I've tried

Re: Need OMF MySQL lib that actually f^*^ works...

2011-07-22 Thread Nick Sabalausky
Dmitry Olshansky dmitry.o...@gmail.com wrote in message news:j0cj58$5i5$1...@digitalmars.com... On 22.07.2011 23:06, Nick Sabalausky wrote: Robert Clipshamrob...@octarineparrot.com wrote in message news:j0ce0t$2rte$1...@digitalmars.com... On 22/07/2011 07:20, Nick Sabalausky wrote: Anyone

Re: Why is a static struct's dtor called at the exit of a function?

2011-07-22 Thread Jonathan M Davis
On Fri, 22 Jul 2011 02:57:38 -0400, Diego Canuhé canuh...@gmail.com wrote: thanks ;) Don't feel bad, static is probably the most abused keyword in D and C++. It has about 3 or 4 meanings depending on context. The interesting thing is that in C++, there's actually a definition for static

Re: does the x64 compiler for linux make x64 executables?

2011-07-22 Thread Jonathan M Davis
McAnany, Charles E Wrote: Hi, all. So I see that there is an Ubuntu dmd that has x86_64 as the CPU column. Before I install Ubuntu to great disappointment, does this mean that I get a 64 bit executable, or does it just mean that the compiler itself is a 64 bit application? Thanks,

can I force a parallel foreach to finish?

2011-07-22 Thread McAnany, Charles E
Hi, all. So I'm getting the classic concurrency noob behavior from this code: shared int times; int[] iterationRange = new int[2500]; foreach (pos, ref i; parallel(iterationRange)){ times++; } writeln(times); } Prints random numbers near 1,000. Looking at the

Re: This seems like what could be a common cause of bugs

2011-07-22 Thread Don
Andrej Mitrovic wrote: This is just an observation, not a question or anything. void main() { enum width = 100; double step = 1 / width; writeln(step); // 0 } I've just had this bug in my code. I forgot to make either width or 1 a floating-point type. IOW, I didn't do this: void

Re: Need OMF MySQL lib that actually f^*^ works...

2011-07-22 Thread Don
Nick Sabalausky wrote: Anyone have a known-working Windows OMF library for MySQL? Static or dynamic, I don't care. I've tried fucking everything and I can't get the dang thing to work. Static was a total no-go. With dynamic, using implib I got it to link, but calling any of it resulted in an

Re: Reference counting questions

2011-07-22 Thread Jesse Phillips
I don't really think stdio is the place to see modern D ref counting. The container class has an Array which is built to use RefCounted. I had tried my and at explaining how to use it: http://stackoverflow.com/ questions/4632355/making-a-reference-counted-object-in-d-using-

How does one correct shadowing (hidden by) errors?

2011-07-22 Thread Tyro[a.c.edwards]
While attempting to build the DFL libraries, I encountered the following three errors: [1] tabcontrol.d(18): Error: class dfl.tabcontrol.TabPage use of dfl.control.Control.opEquals(Control ctrl) hidden by TabPage is deprecated [2] tabcontrol.d(18): Error: class dfl.tabcontrol.TabPage use of