Re: UDP enhancement

2013-07-06 Thread Jacob Carlborg
On 2013-07-05 14:31, Andrej Mitrovic wrote: Related: https://github.com/D-Programming-Language/dmd/pull/1485 Although this pull does the opposite of what's requested here. In this case I don't think you want to show the methods the mixin expands to. -- /Jacob Carlborg

Re: UDP enhancement

2013-07-05 Thread Jacob Carlborg
On 2013-07-03 03:42, Daniel Murphy wrote: You should probably try using template mixins, if all you need to do is expand some code. I don't think that works so well together with ddoc comments. Ideally you should be able to do something like this: class Foo { /// Get/set bar mixin

Re: UDP enhancement

2013-07-05 Thread Daniel Murphy
Jacob Carlborg d...@me.com wrote in message news:kr673g$179s$1...@digitalmars.com... On 2013-07-03 03:42, Daniel Murphy wrote: You should probably try using template mixins, if all you need to do is expand some code. I don't think that works so well together with ddoc comments. Ideally you

Re: UDP enhancement

2013-07-05 Thread Andrej Mitrovic
On 7/5/13, Jacob Carlborg d...@me.com wrote: I don't think that works so well together with ddoc comments. Ideally you should be able to do something like this: class Foo { /// Get/set bar mixin property!(int, bar); } Related:

Re: UDP enhancement

2013-07-05 Thread Wyatt
On Monday, 1 July 2013 at 01:35:40 UTC, Jonathan M Davis wrote: I believe that the way that this sort of enhancement has typically been suggested Oh hey, I remember the DIP23 madness. Is it that time again already? is to do something like public @property int value; Yes. Please, yes.

Re: UDP enhancement

2013-07-05 Thread Timon Gehr
On 07/05/2013 03:53 PM, Wyatt wrote: On Monday, 1 July 2013 at 01:35:40 UTC, Jonathan M Davis wrote: I believe that the way that this sort of enhancement has typically been suggested Oh hey, I remember the DIP23 madness. Is it that time again already? is to do something like public

Re: UDP enhancement

2013-07-05 Thread Idan Arye
On Wednesday, 3 July 2013 at 01:42:06 UTC, Daniel Murphy wrote: You should probably try using template mixins, if all you need to do is expand some code. https://github.com/D-Programming-Language/phobos/pull/1294

Re: UDP enhancement

2013-07-02 Thread JS
On Tuesday, 2 July 2013 at 04:49:55 UTC, estew wrote: It's location in the class my not be the same but that is, in general, irrelevant unless you are messing with the bits of the class. Actually we do this a lot in C++ where I work to ensure proper alignment. We are also starting to

Re: UDP enhancement

2013-07-02 Thread Kapps
On Monday, 1 July 2013 at 01:35:40 UTC, Jonathan M Davis wrote: I believe that the way that this sort of enhancement has typically been suggested is to do something like public @property int value; which would be lowered to something like public @property int value() @safe const pure

Re: UDP enhancement

2013-07-02 Thread Jonathan M Davis
On Tuesday, July 02, 2013 19:49:39 Kapps wrote: On Monday, 1 July 2013 at 01:35:40 UTC, Jonathan M Davis wrote: I believe that the way that this sort of enhancement has typically been suggested is to do something like public @property int value; which would be lowered to something

Re: UDP enhancement

2013-07-02 Thread Daniel Murphy
Kapps opantm2+s...@gmail.com wrote in message news:zroaabiwkaxqybrtd...@forum.dlang.org... As someone who uses properties almost everywhere, and almost never uses public fields, this is one of my biggest gripes with D remaining. It's incredibly annoying to have to do things like private

Re: UDP enhancement

2013-07-01 Thread Jacob Carlborg
On 2013-07-01 03:43, JS wrote: But yet absolutely useless and does nothing over using a field directly. The advantage is that you get virtual methods. I also think it should be possible to manually implement just the setter, or getter. The compiler would only generate what's not already

Re: UDP enhancement

2013-07-01 Thread Ali Çehreli
On 06/30/2013 08:54 PM, JS wrote: On Monday, 1 July 2013 at 02:17:24 UTC, Ali Çehreli wrote: I have the complete opposite view: Seeing what m_data explicitly in the code would be simpler than reading code to see that data.value would mean implicit storage. huh? There is absolutely no

Re: UDP enhancement

2013-07-01 Thread JS
On Monday, 1 July 2013 at 16:24:40 UTC, Ali Çehreli wrote: On 06/30/2013 08:54 PM, JS wrote: On Monday, 1 July 2013 at 02:17:24 UTC, Ali Çehreli wrote: I have the complete opposite view: Seeing what m_data explicitly in the code would be simpler than reading code to see that data.value

Re: UDP enhancement

2013-07-01 Thread estew
It's location in the class my not be the same but that is, in general, irrelevant unless you are messing with the bits of the class. Actually we do this a lot in C++ where I work to ensure proper alignment. We are also starting to do this in D where we have C++ - D bindings so we can make

UDP enhancement

2013-06-30 Thread JS
struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write property private: int m_data; } It would be nice if properties had an internal variable to use instead of having to declare it explicitly:

Re: UDP enhancement

2013-06-30 Thread Jonathan M Davis
On Monday, July 01, 2013 03:22:15 JS wrote: struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write property private: int m_data; } It would be nice if properties had an internal variable to

Re: UDP enhancement

2013-06-30 Thread JS
On Monday, 1 July 2013 at 01:35:40 UTC, Jonathan M Davis wrote: On Monday, July 01, 2013 03:22:15 JS wrote: struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write property private: int m_data; }

Re: UDP enhancement

2013-06-30 Thread Timon Gehr
On 07/01/2013 03:22 AM, JS wrote: struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write property private: int m_data; } It would be nice if properties had an internal variable to use instead of

Re: UDP enhancement

2013-06-30 Thread Andrej Mitrovic
On 7/1/13, JS js.m...@gmail.com wrote: But yet absolutely useless and does nothing over using a field directly. Not completely useless, this syntax would theoretically disallow taking the address of such a field.

Re: UDP enhancement

2013-06-30 Thread Jonathan M Davis
On Monday, July 01, 2013 04:03:41 Andrej Mitrovic wrote: On 7/1/13, JS js.m...@gmail.com wrote: But yet absolutely useless and does nothing over using a field directly. Not completely useless, this syntax would theoretically disallow taking the address of such a field. Yeah. public

Re: UDP enhancement

2013-06-30 Thread Piotr Szturmaj
W dniu 01.07.2013 03:35, Jonathan M Davis pisze: On Monday, July 01, 2013 03:22:15 JS wrote: struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write property private: int m_data; } It would be

Re: UDP enhancement

2013-06-30 Thread Ali Çehreli
On 06/30/2013 06:43 PM, JS wrote: On Monday, July 01, 2013 03:22:15 JS wrote: struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write property private: int m_data; } It would be nice if

Re: UDP enhancement

2013-06-30 Thread JS
On Monday, 1 July 2013 at 02:17:24 UTC, Ali Çehreli wrote: On 06/30/2013 06:43 PM, JS wrote: On Monday, July 01, 2013 03:22:15 JS wrote: struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write