Re: Problem with Hiredis Binding

2012-01-06 Thread Mike Parker
On 1/6/2012 2:34 PM, Puming wrote: In http://dlang.org/interfaceToC.html it says in 32bit system c_long is equivalent to `long long` in C. Is this wrong? Well, either the documentation is wrong or the implementation is. Looks like one for Bugzilla.

Re: Singleton Pattern

2012-01-06 Thread asm
thank you, you answer is very helpful.

Re: Problem with Hiredis Binding

2012-01-06 Thread Johannes Pfau
Mike Parker wrote: On 1/6/2012 2:34 PM, Puming wrote: In http://dlang.org/interfaceToC.html it says in 32bit system c_long is equivalent to `long long` in C. Is this wrong? Well, either the documentation is wrong or the implementation is. Looks like one for Bugzilla. The documentation

Re: Bug or feature? std.c.stdlib.exit() breaks RAII

2012-01-06 Thread Stewart Gordon
On 29/12/2011 19:09, Jacob Carlborg wrote: snip excessive quote Could druntime hook up on the atexit function to run destructors and similar when the program exits? I'm not sure. Maybe it could be called upon to run static destructors and destruct heap-allocated objects. But in order to

Re: Bug or feature? std.c.stdlib.exit() breaks RAII

2012-01-06 Thread Andrej Mitrovic
That should have been int main.

Compile-time evaluation of real expressions?

2012-01-06 Thread H. S. Teoh
Hi All, As I understand it, compile-time execution *should* be able to evaluate floating-point functions, correct? Currently, I have this code: private static real cross_angles[6] = [ real.nan, real.nan, real.nan,

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread Alex Rønne Petersen
On 06-01-2012 23:21, H. S. Teoh wrote: Hi All, As I understand it, compile-time execution *should* be able to evaluate floating-point functions, correct? Currently, I have this code: private static real cross_angles[6] = [ real.nan, real.nan,

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread Jonathan M Davis
On Saturday, January 07, 2012 00:03:39 Alex Rønne Petersen wrote: Most likely those functions are just implemented using inline assembly, therefore not usable in CTFE. Yeah, several functions in std.math use inline assembly. So, for them to be able to be used at compile time, either the

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread Ali Çehreli
On 01/06/2012 03:37 PM, Jonathan M Davis wrote: An enhancement request for it should probably be opened: d.puremagi.com/issues http://d.puremagic.com/issues/ Ali

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread Alex Rønne Petersen
On 07-01-2012 00:37, Jonathan M Davis wrote: On Saturday, January 07, 2012 00:03:39 Alex Rønne Petersen wrote: Most likely those functions are just implemented using inline assembly, therefore not usable in CTFE. Yeah, several functions in std.math use inline assembly. So, for them to be able

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread H. S. Teoh
On Sat, Jan 07, 2012 at 12:49:46AM +0100, Alex Rønne Petersen wrote: On 07-01-2012 00:37, Jonathan M Davis wrote: On Saturday, January 07, 2012 00:03:39 Alex Rønne Petersen wrote: Most likely those functions are just implemented using inline assembly, therefore not usable in CTFE. Yeah,

Re: An issue with lazy delegates

2012-01-06 Thread Peter Alexander
On 5/01/12 5:26 AM, Andrej Mitrovic wrote: The first call doesn't do anything because the delegate is wrapped inside of another delegate. I want this template to be versatile enough to be used by both lazy expressions and delegate literals, but I don't know how. void test(T)(lazy T dg) {

Re: Is this really a bug?

2012-01-06 Thread Peter Alexander
On 7/01/12 1:19 AM, Daniel wrote: Hi, I've read on Bugzilla Issue 6398 that this is a bug: static int value; ref foo(){ printf(getter\n); return value; } ref foo(int x){ printf(setter\n); value = x; return value; } void main(){ foo = 1; } // Should print setter, but print getter in 2.054

Re: An issue with lazy delegates

2012-01-06 Thread Andrej Mitrovic
Hah, I never thought of using that check. Thanks.

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread Robert Clipsham
On 07/01/2012 00:31, H. S. Teoh wrote: I admit I've no idea how the D compiler implements compile-time evaluation, but is it possible for the compiler to actually emit code for compile-time functions containing asm blocks and, say, execute it in a sandbox, and read the values out from the

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread Robert Clipsham
On 07/01/2012 02:28, H. S. Teoh wrote: On Sat, Jan 07, 2012 at 02:15:39AM +, Robert Clipsham wrote: On 07/01/2012 00:31, H. S. Teoh wrote: I admit I've no idea how the D compiler implements compile-time evaluation, but is it possible for the compiler to actually emit code for compile-time

Re: Compile-time evaluation of real expressions?

2012-01-06 Thread Timon Gehr
On 01/07/2012 12:37 AM, Jonathan M Davis wrote: On Saturday, January 07, 2012 00:03:39 Alex Rønne Petersen wrote: Most likely those functions are just implemented using inline assembly, therefore not usable in CTFE. Yeah, several functions in std.math use inline assembly. So, for them to be