Feedback Thread: DIP 1043--Shortened Method Syntax--Final Review

Salih Dincer salihdb at hotmail.com
Thu Jun 16 18:09:36 UTC 2022


On Wednesday, 15 June 2022 at 09:21:58 UTC, Mike Parker wrote:

> [..] in the Reviewer Guidelines (and listed at the bottom of 
> this post).
>
> https://github.com/dlang/DIPs/blob/master/docs/guidelines-reviewers.md

I don't need to write at length. The only thing I always have 
difficulty with is writing a class constructor!

```d
struct Color {}
class Point {
   Color rgba;
   int x, y;
   bool hidden;

   this(Color r, int x, int y, bool h) {
     this.rgba = r;
     this.x = x;
     this.y = y;
     this.hidden = h;
   }
}
```
Well if it was shorter we would compile it right away, just like 
a struct. For example:

```d
   // ...
   this(@all);
}
```
SDB at 79


More information about the Digitalmars-d mailing list