Re: compile-time initialization of objects need?

2008-12-28 Thread Christopher Wright
Weed wrote: Christopher Wright пишет: Weed wrote: It not syntactic sugar. I suggest not to waste time at all performance on run-time initialization of objects and check of side conditions on a course of performance of the program. Sorry, syntactic sugar and some minor optimizations. These o

Re: compile-time initialization of objects need?

2008-12-28 Thread Weed
Christopher Wright пишет: > Weed wrote: >> It not syntactic sugar. I suggest not to waste time at all performance >> on run-time initialization of objects and check of side conditions on a >> course of performance of the program. > > Sorry, syntactic sugar and some minor optimizations. These of

Re: compile-time initialization of objects need?

2008-12-28 Thread Christopher Wright
Weed wrote: It not syntactic sugar. I suggest not to waste time at all performance on run-time initialization of objects and check of side conditions on a course of performance of the program. Sorry, syntactic sugar and some minor optimizations.

Re: compile-time initialization of objects need?

2008-12-28 Thread Weed
Christopher Wright пишет: > Weed wrote: >> In fact, the D is not contain a mechanism for compile-time >> initialization of objects. Maybe add? >> void main() >> { >> S a = S(8); // ok >> static S b = S(8); // error >> } > > You want syntactic sugar for two things: > > // example 1 > void

Re: compile-time initialization of objects need?

2008-12-27 Thread Christopher Wright
Weed wrote: In fact, the D is not contain a mechanism for compile-time initialization of objects. Maybe add? void main() { S a = S(8); // ok static S b = S(8); // error } You want syntactic sugar for two things: // example 1 void foo () { static S s; static bool s_initi

compile-time initialization of objects need?

2008-12-26 Thread Weed
In fact, the D is not contain a mechanism for compile-time initialization of objects. Maybe add? For example, that would be very usable for any objects which have mathematical primitives. Example: struct S { float[10] array; this( float f ) { array[0] = f; } } void main