Re: Is this actually valid code?

2011-11-06 Thread Jonathan M Davis
On Monday, November 07, 2011 05:10:57 Andrej Mitrovic wrote: > I've had a simple problem where I've only wanted to override a setter > from a base class: > > class Foo > { > @property void test(int) {} > @property int test() { return 1; } > } > > class Bar : Foo > { > override @proper

Is this actually valid code?

2011-11-06 Thread Andrej Mitrovic
I've had a simple problem where I've only wanted to override a setter from a base class: class Foo { @property void test(int) {} @property int test() { return 1; } } class Bar : Foo { override @property void test(int) {} void bartest() { auto x = test; } // NG } test.d(19): Erro

Re: Expected or Bug? struct range unmodified after foreach

2011-11-06 Thread Jonathan M Davis
On Sunday, November 06, 2011 23:26:02 Jesse Phillips wrote: > I'm sure if this was changed there would be other interesting behavior, > such as arrays being consumed. And suggestions other than > > for(S s; !s.empty, s.popFront())... > > Example: > > void main() { > S s; > >

Expected or Bug? struct range unmodified after foreach

2011-11-06 Thread Jesse Phillips
I'm sure if this was changed there would be other interesting behavior, such as arrays being consumed. And suggestions other than for(S s; !s.empty, s.popFront())... Example: void main() { S s; foreach(i; s) { assert(i == s.popCount); // Fail }

Re: IDE with renaming possibility

2011-11-06 Thread Caligo
On Sun, Nov 6, 2011 at 9:28 AM, Jabba Laci wrote: > Hi, > > I'm new to D, I just started to read the book of Andrei. > > As an IDE, I use Eclipse with the DDT plugin. However, I don't find an > important feature: renaming variables/functions/etc. If it's not in > DDT, what IDE do you suggest? I u

Re: odd use of preprocessor

2011-11-06 Thread Michel Fortin
On 2011-11-06 19:43:15 +, Ellery Newcomer said: /* Error values. */ enum { DW_TAG_invalid = 0 #define DW_TAG_invalid DW_TAG_invalid }; It's strange all right. The only reason I can come with is that they want to prevent someone else from defining DW_TAG_invalid as a preproces

IDE with renaming possibility

2011-11-06 Thread Jabba Laci
Hi, I'm new to D, I just started to read the book of Andrei. As an IDE, I use Eclipse with the DDT plugin. However, I don't find an important feature: renaming variables/functions/etc. If it's not in DDT, what IDE do you suggest? I use Linux. Thanks, Laszlo

Re: odd use of preprocessor

2011-11-06 Thread Ellery Newcomer
On 11/06/2011 01:50 PM, Alex Rønne Petersen wrote: > On 06-11-2011 20:43, Ellery Newcomer wrote: >> poking about in elfutils headers, I've come across the following idiom >> several times >> >> /* Error values. */ >> enum >>{ >> DW_TAG_invalid = 0 >> #define DW_TAG_invalid DW_TAG_invalid

Re: odd use of preprocessor

2011-11-06 Thread Alex Rønne Petersen
On 06-11-2011 20:43, Ellery Newcomer wrote: poking about in elfutils headers, I've come across the following idiom several times /* Error values. */ enum { DW_TAG_invalid = 0 #define DW_TAG_invalid DW_TAG_invalid }; anyone know if anything strange is going on here that would preve

odd use of preprocessor

2011-11-06 Thread Ellery Newcomer
poking about in elfutils headers, I've come across the following idiom several times /* Error values. */ enum { DW_TAG_invalid = 0 #define DW_TAG_invalid DW_TAG_invalid }; anyone know if anything strange is going on here that would prevent trivial conversion to d?

Re: AA clear property

2011-11-06 Thread Alex_Dovhal
Thakns for details. Arfer another small benchmark, it appeared that addition to AA is 10x times slower than removal from it. So that's why (2) isn't so bad in my previous tests - most of time AA was adding elements to remove later. Anyway if (2) also reallocates it's much much worse that (1).

Re: AA clear property

2011-11-06 Thread Jonathan M Davis
On Sunday, November 06, 2011 04:11:07 Jonathan M Davis wrote: > On Sunday, November 06, 2011 13:39:27 Alex_Dovhal wrote: > > "Marco Leise" wrote: > > > No way I heard of. You could delete the entries one by one. :D > > > I guess setting all references to null is the easiest way to 'clear' > > > an

Re: AA clear property

2011-11-06 Thread Jonathan M Davis
On Sunday, November 06, 2011 13:39:27 Alex_Dovhal wrote: > "Marco Leise" wrote: > > No way I heard of. You could delete the entries one by one. :D > > I guess setting all references to null is the easiest way to 'clear' an > > AA. > > Thanks. I tried both of them in small benchmark. Results are >

Re: AA clear property

2011-11-06 Thread Alex_Dovhal
"Marco Leise" wrote: > No way I heard of. You could delete the entries one by one. :D > I guess setting all references to null is the easiest way to 'clear' an > AA. Thanks. I tried both of them in small benchmark. Results are (1) fill_values(aa); aa = null (2) fill_values(aa); aa.remove(...) For

Re: AA clear property

2011-11-06 Thread Marco Leise
Am 06.11.2011, 00:15 Uhr, schrieb Alex_Dovhal : "Marco Leise" wrote: Are you this Alex? yes. As I understand it this function is defined in object_.d which is always imported by default and can be called on an (associative) array through a mechanism called "universal function call", that