Re: Is @disable obsolete?

2025-08-05 Thread monkyyy via Digitalmars-d-learn
On Wednesday, 6 August 2025 at 00:42:43 UTC, Brother Bill wrote: It doesn't seem like modern D needs the @disable feature. If a struct has a user provided constructor, then the default constructor is removed. Are there any cases where @disable is useful in modern D? it always seemed like a

Is @disable obsolete?

2025-08-05 Thread Brother Bill via Digitalmars-d-learn
It doesn't seem like modern D needs the @disable feature. If a struct has a user provided constructor, then the default constructor is removed. Are there any cases where @disable is useful in modern D?

Re: struct parameterless constructor

2025-08-05 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Aug 05, 2025 at 03:27:06AM -0600, Jonathan M Davis via Digitalmars-d-learn wrote: > On Monday, August 4, 2025 5:21:53 PM Mountain Daylight Time H. S. Teoh via > Digitalmars-d-learn wrote: > > Fast forward 20 or so years, and things have changed a bit. People > > started using structs for

Re: Non-static foreach on tupleof has no UDAs?

2025-08-05 Thread monkyyy via Digitalmars-d-learn
On Tuesday, 5 August 2025 at 14:19:16 UTC, IchorDev wrote: On Thursday, 31 July 2025 at 14:44:21 UTC, monkyyy wrote: On Thursday, 31 July 2025 at 11:29:41 UTC, IchorDev wrote: I'd much prefer if the above code worked rather than having to do this: ```d static foreach(i; 0..a.tupleof.length){

Re: Non-static foreach on tupleof has no UDAs?

2025-08-05 Thread IchorDev via Digitalmars-d-learn
On Thursday, 31 July 2025 at 14:44:21 UTC, monkyyy wrote: On Thursday, 31 July 2025 at 11:29:41 UTC, IchorDev wrote: I'd much prefer if the above code worked rather than having to do this: ```d static foreach(i; 0..a.tupleof.length){ pragma(msg, __traits(getAttributes, a.tupleof[i])); //Alias

Re: Is D overly complex?

2025-08-05 Thread IchorDev via Digitalmars-d-learn
On Tuesday, 5 August 2025 at 12:32:53 UTC, Brother Bill wrote: I am in my learning curve for D as an experienced developer. What has attracted me to D is the combination of features: Design by Contract, Functional Programming, OOP, and more. But I have been exploring the "weeds" and am curious i

Re: Is D overly complex?

2025-08-05 Thread Bradley Chatha via Digitalmars-d-learn
On Tuesday, 5 August 2025 at 12:32:53 UTC, Brother Bill wrote: I am in my learning curve for D as an experienced developer. What has attracted me to D is the combination of features: Design by Contract, Functional Programming, OOP, and more. This is both one of the strong and weak points of D:

Re: Is D overly complex?

2025-08-05 Thread user1234 via Digitalmars-d-learn
On Tuesday, 5 August 2025 at 12:32:53 UTC, Brother Bill wrote: I am in my learning curve for D as an experienced developer. [...] Should D be considered a language that should be learned in its entirety? Or should most developers stick to the "Safe D" subset? I think what you should get is th

Re: Is D overly complex?

2025-08-05 Thread monkyyy via Digitalmars-d-learn
On Tuesday, 5 August 2025 at 12:32:53 UTC, Brother Bill wrote: Every language has its "nits", even Eiffel. The concern is whether that is a straight forward approach to get things done, avoid the "dragons", and work with existing libraries without needing a "wizard" to cast some spells. Shou

Is D overly complex?

2025-08-05 Thread Brother Bill via Digitalmars-d-learn
I am in my learning curve for D as an experienced developer. What has attracted me to D is the combination of features: Design by Contract, Functional Programming, OOP, and more. But I have been exploring the "weeds" and am curious if D is only for rocket scientists or for regular programmers, i

Re: struct parameterless constructor

2025-08-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, August 4, 2025 2:02:48 PM Mountain Daylight Time Brother Bill via Digitalmars-d-learn wrote: > I feel like I am going into the hornet's nest with this > discussion. > > I have created a struct with some members, and want to have a > parameterless constructor that sets the member values

Re: struct parameterless constructor

2025-08-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, August 4, 2025 5:21:53 PM Mountain Daylight Time H. S. Teoh via Digitalmars-d-learn wrote: > Fast forward 20 or so years, and things have changed a bit. People > started using structs for many other things, some beyond the original > design, and inevitably ran into cases where they rea