Re: Compiling shared example.

2012-10-28 Thread Ali Çehreli
On 10/26/2012 02:22 PM, Peter Sommerfeld wrote: To learn about shared attribute I've copied nearly verbatim an example from Andreis book. The code: import core.atomic; struct Data{ int value; } shared struct SharedStack(T) { private shared struct Node{ T data; Node* next; this(T value){data

portable windowing und graphics libraries

2012-10-28 Thread hr
hi, did anybody by chance port the libraries from: http://www.tecgraf.puc-rio.br/iup/ already to d? thanks

Re: portable windowing und graphics libraries

2012-10-28 Thread thedeemon
On Sunday, 28 October 2012 at 08:42:35 UTC, hr wrote: hi, did anybody by chance port the libraries from: http://www.tecgraf.puc-rio.br/iup/ already to d? thanks There is a C interface, so it should be usable directly from D. Just link and call. Is there something to port?

Re: Copying with immutable arrays

2012-10-28 Thread Tobias Pankrath
Thank you for your detailed answer! What I don't understand is the reason why you need the .dup in the first place. Take a look at these two structs that now contain an int* and an int instead of string[]. struct SA { int i; } struct SB { int* i; } If you try to .dup an array of

Re: Compiling shared example.

2012-10-28 Thread Peter Sommerfeld
Am 28.10.2012, 08:06 Uhr, schrieb Ali Çehreli acehr...@yahoo.com: On 10/26/2012 02:22 PM, Peter Sommerfeld wrote: To learn about shared attribute I've copied nearly verbatim an example from Andreis book. The code: import core.atomic; struct Data{ int value; } shared struct SharedStack(T) {

Re: scope(failure): get exception

2012-10-28 Thread Jacob Carlborg
On 2012-10-26 23:56, Jonathan M Davis wrote: Yes. It lowers to a try-catch block, but that's effectively an implementation detail. As it stands, technically speaking, a compiler could probably implement it without any lowering whatsoever (I don't think that the spec says anything about how it's

Re: scope(failure): get exception

2012-10-28 Thread Jonathan M Davis
On Sunday, October 28, 2012 13:08:50 Jacob Carlborg wrote: What about allowing catch-statements without a try-statement, something like this: void foo () { // some code ... catch (Exception e) { } } This would be the same as the whole function would be wrapped

crash suggestions

2012-10-28 Thread Dan
I'm having a crash I've been unable to figure out. I have a small pretty print function that so far has handled most of my needs. However while debugging I threw something at it that caused a crash, so I know it must have an issue. The portion calling out to pp is --- double getRate(double

What is the proper way to handle pointers in variable arguments list?

2012-10-28 Thread Tyro[17]
The following fails because the compiler assumes I am trying to dereference non-pointer variables. Can this be done? void main() { int i; int* pi; double d; double* pd; char c; char* pc; scan(i, pi, d, pd, c, pc); } void scan(A...)(ref A data) { import

Re: What is the proper way to handle pointers in variable arguments list?

2012-10-28 Thread Dmitry Olshansky
On 29-Oct-12 00:36, Tyro[17] wrote: The following fails because the compiler assumes I am trying to dereference non-pointer variables. Can this be done? void main() { int i; int* pi; double d; double* pd; char c; char* pc; scan(i, pi, d, pd, c, pc); } void

Re: What is the proper way to handle pointers in variable arguments list?

2012-10-28 Thread Tyro[17]
On 10/28/12 4:44 PM, Dmitry Olshansky wrote: On 29-Oct-12 00:36, Tyro[17] wrote: The following fails because the compiler assumes I am trying to dereference non-pointer variables. Can this be done? void main() { int i; int* pi; double d; double* pd; char c; char*

Re: What is the proper way to handle pointers in variable arguments list?

2012-10-28 Thread Simen Kjaeraas
On 2012-08-28 22:10, Tyro[17] nos...@home.com wrote: On 10/28/12 4:44 PM, Dmitry Olshansky wrote: On 29-Oct-12 00:36, Tyro[17] wrote: The following fails because the compiler assumes I am trying to dereference non-pointer variables. Can this be done? void main() { int i; int* pi;

Re: What is the proper way to handle pointers in variable arguments list?

2012-10-28 Thread Tyro[17]
On 10/28/12 5:16 PM, Simen Kjaeraas wrote: On 2012-08-28 22:10, Tyro[17] nos...@home.com wrote: On 10/28/12 4:44 PM, Dmitry Olshansky wrote: On 29-Oct-12 00:36, Tyro[17] wrote: The following fails because the compiler assumes I am trying to dereference non-pointer variables. Can this be

Reading results from dmd -profile

2012-10-28 Thread cal
I am trying to read the text file (trace.log) created by running the dmd profiler on some code, so that I can use demangle to make the output a bit more readable. I can read it in as a char[], but the whenever I try any string ops I get an exception because there are invalid UTF-8 sequences in

Re: crash suggestions

2012-10-28 Thread Ali Çehreli
On 10/28/2012 11:38 AM, Dan wrote: I'm having a crash I've been unable to figure out. I have a small pretty print function that so far has handled most of my needs. However while debugging I threw something at it that caused a crash, so I know it must have an issue. The portion calling out