Re: Would this be a useful construct to add to D? auto for constructor call.

2024-01-27 Thread Chris Katko via Digitalmars-d-announce
On Wednesday, 24 January 2024 at 08:22:49 UTC, Walter Bright wrote: On 1/23/2024 8:01 AM, Steven Schveighoffer wrote: zero proposals that infer type from how they are used have been accepted by Walter, this one probably will be no different. Types are inferred in D from the bottom up. Mixing

Re: Would this be a useful construct to add to D? auto for constructor call.

2024-01-24 Thread Walter Bright via Digitalmars-d-announce
On 1/23/2024 8:01 AM, Steven Schveighoffer wrote: zero proposals that infer type from how they are used have been accepted by Walter, this one probably will be no different. Types are inferred in D from the bottom up. Mixing in special cases of it being top down leads to confusion over how

Re: Would this be a useful construct to add to D? auto for constructor call.

2024-01-23 Thread Steven Schveighoffer via Digitalmars-d-announce
On Tuesday, 23 January 2024 at 11:11:00 UTC, ryuukk_ wrote: On Tuesday, 23 January 2024 at 06:30:08 UTC, Jonathan M Davis wrote: That being said, I expect that it would be pretty easy to write a mixin to do something like that if you really wanted to. Also, if you're simply looking to not have

Re: Would this be a useful construct to add to D? auto for constructor call.

2024-01-23 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, January 23, 2024 4:11:00 AM MST ryuukk_ via Digitalmars-d-announce wrote: > On Tuesday, 23 January 2024 at 06:30:08 UTC, Jonathan M Davis > > wrote: > > That being said, I expect that it would be pretty easy to write > > a mixin to do something like that if you really wanted to. > >

Re: Would this be a useful construct to add to D? auto for constructor call.

2024-01-23 Thread Sergey via Digitalmars-d-announce
On Tuesday, 23 January 2024 at 11:11:00 UTC, ryuukk_ wrote: [OT] btw what did you find? Which one could you recommend? https://forum.dlang.org/post/cqgrciflmvuwonsnz...@forum.dlang.org

Re: Would this be a useful construct to add to D? auto for constructor call.

2024-01-23 Thread ryuukk_ via Digitalmars-d-announce
On Tuesday, 23 January 2024 at 06:30:08 UTC, Jonathan M Davis wrote: That being said, I expect that it would be pretty easy to write a mixin to do something like that if you really wanted to. Also, if you're simply looking to not have to name the type, you could do dataGrid = new

Re: Would this be a useful construct to add to D? auto for constructor call.

2024-01-22 Thread Jonathan M Davis via Digitalmars-d-announce
On Monday, January 22, 2024 11:05:28 PM MST Chris Katko via Digitalmars-d- announce wrote: > ```D > class dataGridLayerView{ > int t; > this(int _t){ >t = _t; >} > } > > class myClass{ > dataGridLayerView dataGrid; > > this() >{ >dataGrid = new

Would this be a useful construct to add to D? auto for constructor call.

2024-01-22 Thread Chris Katko via Digitalmars-d-announce
```D class dataGridLayerView{ int t; this(int _t){ t = _t; } } class myClass{ dataGridLayerView dataGrid; this() { dataGrid = new auto(15); // <--- new // instead of dataGrid = new dataGridLayerView(15); } } ``` Because it seems,