www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Improvements to the annotation functionality

reply Brian <zoujiaqing gmail.com> writes:
I want and I think:

```D

struct A
{
     int x = 1;
     int y = 2;
     int z = 3;
     string a = "a";
     string b = "b";

     this(int x, int y, int z, string a, string b)
     {
         this.x = x;
         thix.y = y;
         this.z = z;
         this.a = a;
         this.b = b;
     }
}

 A(1, 2, 3, "a", "b")
void test1()
{
     // TODO
}


 A(z=9, b="bbb")
void test2()
{
     // TODO
}

```

Member assignments can be specified, seem test2().
Jan 09 2019
next sibling parent Neia Neutuladh <neia ikeran.org> writes:
On Thu, 10 Jan 2019 04:46:28 +0000, Brian wrote:
  A(z=9, b="bbb")
Named function parameters would give you that. There are a couple proposals floating around. Generalized struct initializer syntax would work, too.
Jan 09 2019
prev sibling parent reply Andre Pany <andre s-e-a-p.de> writes:
On Thursday, 10 January 2019 at 04:46:28 UTC, Brian wrote:
 I want and I think:

 ```D

 struct A
 {
     int x = 1;
     int y = 2;
     int z = 3;
     string a = "a";
     string b = "b";

     this(int x, int y, int z, string a, string b)
     {
         this.x = x;
         thix.y = y;
         this.z = z;
         this.a = a;
         this.b = b;
     }
 }

  A(1, 2, 3, "a", "b")
 void test1()
 {
     // TODO
 }


  A(z=9, b="bbb")
 void test2()
 {
     // TODO
 }

 ```

 Member assignments can be specified, seem test2().
https://github.com/wilzbach/DIPs/blob/b1283b455b635d7dcbc2c871d2aa47cc67190059/DIPs/DIP1xxx-sw.md How can we proceed with this DIP? Kind regards Andre
Jan 09 2019
parent reply Mike Parker <aldacron gmail.com> writes:
On Thursday, 10 January 2019 at 06:41:54 UTC, Andre Pany wrote:

 https://github.com/wilzbach/DIPs/blob/b1283b455b635d7dcbc2c871d2aa47cc67190059/DIPs/DIP1xxx-sw.md

 How can we proceed with this DIP?
I've been in contact with Sebastian about it and he isn't ready to move forward with it yet. When he is, it will get priority because it's been there so long.
Jan 10 2019
parent Brian <zoujiaqing gmail.com> writes:
On Thursday, 10 January 2019 at 10:49:42 UTC, Mike Parker wrote:
 On Thursday, 10 January 2019 at 06:41:54 UTC, Andre Pany wrote:

 https://github.com/wilzbach/DIPs/blob/b1283b455b635d7dcbc2c871d2aa47cc67190059/DIPs/DIP1xxx-sw.md

 How can we proceed with this DIP?
I've been in contact with Sebastian about it and he isn't ready to move forward with it yet. When he is, it will get priority because it's been there so long.
Thank you! We need it to simplify development some framework.
Jan 22 2019