Re: Would this be a useful construct to add to D? auto for constructor call.
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 to name the type, you could do dataGrid = new typeof(datagrid)(15); You like to turn off people before they get the chance to develop further, this is bad Would you like to encourage proposals/work/effort that will ultimately not be accepted? I don't. I would rather tell someone no early than tell them no later. And I agree with Jonathan, zero proposals that infer type from how they are used have been accepted by Walter, this one probably will be no different. To the OP, I think the value of the feature needs to be more than just avoiding repeating the name of the type. You also can do some library tricks (unfortunately this won't count as construction, but probably is fine in most cases) ```d auto create(T, Args...)(out T val, Args args) { static if(is(T == class)) val = new T(args); else static if(...) // do eveyrything else. } ... dataGrid.create(15); ``` -Steve
DConf Online '24: Still have room for talks
If you waffled over whether or not to submit a talk for DConf Online '24, we still have space for some. If we don't get anymore, then it's going to be a one-day event. I'd very much like to make it two. I'll waive the requirement for a video submission. Just let me know the talk title and an abstract, with a bit of a description of how it will go. Remember, we want to keep them around 20-30 minutes.
Re: DConf Online '24: Still have room for talks
On Tuesday, 23 January 2024 at 15:40:02 UTC, Mike Parker wrote: If you waffled over whether or not to submit a talk for DConf Online '24, we still have space for some. If we don't get anymore, then it's going to be a one-day event. I'd very much like to make it two. I'll waive the requirement for a video submission. Just let me know the talk title and an abstract, with a bit of a description of how it will go. Remember, we want to keep them around 20-30 minutes. Oh, and the original announcement was here: https://forum.dlang.org/post/owawpppuujgemsuui...@forum.dlang.org
Re: Preparing for the New DIP Process
On Tuesday, 23 January 2024 at 07:29:33 UTC, Danilo wrote: The people who still put 50,000 LOC into a single file will not be happy with this. ;) Fair enough. I'm also not happy with their code.
Re: Would this be a useful construct to add to D? auto for constructor call.
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. > > Also, if you're simply looking to not have to name the type, > > you could do > > > > dataGrid = new typeof(datagrid)(15); > > > > - Jonathan M Davis > > You like to turn off people before they get the chance to develop > further, this is bad > > You should try more languages, it'll be eye opener > > ``dataGrid = new typeof(datagrid)(15);`` is both, verbose and ugly > > Besides, you seem to have missed this: > > https://github.com/dlang/DIPs/blob/e2ca557ab9d3e60305a37da0d5b58299e0a9de0e/ > DIPs/DIP1044.md > > https://github.com/dlang/dmd/pull/14650 > > It could be expanded with structs/classes > > So your "it can't be done" argument is already wrong I never said that it couldn't be done. I said that it goes against how expressions and assignment in D normally work, so it's probably not a change that would be accepted. And the DIP and PR that you linked to have been rejected. If the OP wants to push for a change like this, then they can, and they might get lucky, but I would expect it to be rejected. Either way, there are ways to do something similar with what we already have, so I pointed them out. While you might not like a solution like using typeof, it is an option that someone can use right now regardless of what improvements we get in the future. - Jonathan M Davis
Re: Would this be a useful construct to add to D? auto for constructor call.
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.
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 typeof(datagrid)(15); - Jonathan M Davis You like to turn off people before they get the chance to develop further, this is bad You should try more languages, it'll be eye opener ``dataGrid = new typeof(datagrid)(15);`` is both, verbose and ugly Besides, you seem to have missed this: https://github.com/dlang/DIPs/blob/e2ca557ab9d3e60305a37da0d5b58299e0a9de0e/DIPs/DIP1044.md https://github.com/dlang/dmd/pull/14650 It could be expanded with structs/classes So your "it can't be done" argument is already wrong