digitalmars.D - Poll: do you use property semantics?
- Rikki Cattermole (12/12) Sep 14 2022 Recently Walter has been wanting to remove language features that
- Daniel N (3/7) Sep 14 2022 Not using.
- ryuukk_ (1/1) Sep 14 2022 I don't use it, and i don't understand why it exist to be honest
- monkyyy (3/16) Sep 14 2022 Delete all @ related features
- IGotD- (6/11) Sep 14 2022 So @property is similar to C# get/set? C# get/set are useful if
- Adam D Ruppe (3/4) Sep 14 2022 Frankly, if you have to ask, then no, you don't use it. The
- rikki cattermole (18/19) Sep 14 2022 No. Getting and setting behavior via a method is not associated with
- =?UTF-8?Q?Ali_=c3=87ehreli?= (7/34) Sep 14 2022 I think I heard about supporting the following as well, which is
- Adam D Ruppe (9/12) Sep 14 2022 Yeah, these and
- Guillaume Piolat (7/16) Sep 14 2022 Please consider "pure". :)
- Ogi (21/22) Sep 14 2022 I would use `@property` a lot if it was actually useful.
- Ruby The Roobster (6/19) Sep 14 2022 I use it (though in my case, the code would still work the same
- rikki cattermole (3/5) Sep 14 2022 Okay, so you don't use the semantics provided by @property, a UDA would
- Ruby The Roobster (5/11) Sep 14 2022 I mean that because properties don't take any arguments, such a
- rikki cattermole (3/15) Sep 14 2022 Okay good good, you are only using the syntax that is what we needed to
- Max Samukha (18/19) Sep 14 2022 How can we use it if it is not implemented?
- Max Samukha (2/4) Sep 14 2022 Without 'ref'
- bauss (6/19) Sep 15 2022 I use it extensively and have since I can remember for all my
- Dukc (5/7) Sep 15 2022 I don't, except maybe for consistency with existing code when
- H. S. Teoh (8/11) Sep 15 2022 Not me. In the past I only did it to satisfy Phobos range APIs, but
- Timon Gehr (6/22) Sep 15 2022 I am pretty sure many (most?) people who rely on those semantics are
- rikki cattermole (3/5) Sep 15 2022 I don't, but if something has to go... Better it be something that
- max haughton (5/18) Sep 15 2022 I rarely set out to use property initially however it is very
- Quirin Schroll (8/21) Sep 16 2022 I don’t. Dump it. Replicate VB.NET’s success story with their
- Olivier Pisano (1/1) Sep 17 2022 No, I don't use @property at all.
- ikelaiah (5/7) Sep 18 2022 Hi Rikki,
- Dom DiSc (8/12) Sep 26 2022 I do - or I would if only they would work - e.g. if x is a
- =?UTF-8?Q?Ali_=c3=87ehreli?= (4/6) Sep 26 2022 That came up a couple of times on this thread.
- Dom DiSc (7/14) Sep 26 2022 I don't think so. Would be an easy lowering.
- Salih Dincer (45/52) Sep 28 2022 A nested struct can do this, but each field needs a new build.
- Timon Gehr (2/15) Sep 26 2022 Also see: https://wiki.dlang.org/DIP24
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (7/7) Sep 28 2022 I'm using @property a lot of places, in the hope that one day it would
- Quirin Schroll (4/9) Sep 29 2022 With other words, you’re setting yourself up to have your code
- Dom DiSc (7/16) Sep 29 2022 Well, sort of. But in hope to get something more useful as it is
- Tejas (3/21) Sep 29 2022 https://dlang.org/spec/function.html#property-functions
- Salih Dincer (4/10) Sep 29 2022 Interestingly, Phobos is full of them. For example, if you are
- Salih Dincer (7/16) Sep 29 2022 No problem for a code gunslinger. Well, we can clean up easily
- razyk (1/1) Sep 30 2022 What '@property' gains or should gain over '// property'?
- Dom DiSc (14/15) Oct 01 2022 It gives you control over the access to a member
- rikki cattermole (2/12) Oct 01 2022 Important to note that none of these things actually apply to @property.
- deadalnix (4/17) Sep 30 2022 Can we fix instead?
- Walter Bright (2/5) Oct 01 2022 Make a proposal.
- Timon Gehr (2/9) Oct 01 2022 https://wiki.dlang.org/DIP24
- razyk (3/4) Oct 01 2022 Diferentiate "property function" and "plain function", why? Just litle
- Timon Gehr (4/11) Oct 01 2022 Because there should be a way to reliably replace fields by functions
- razyk (2/5) Oct 01 2022 A long time ago D fully support that with more general rule.
- Timon Gehr (2/10) Oct 01 2022 No, and there is no way to make it work.
- deadalnix (6/10) Oct 01 2022 Current behavior is significantly more complex than what Timon
- deadalnix (2/7) Oct 01 2022 Timon did like 10 years ago.
Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functions
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsNot using.
Sep 14 2022
I don't use it, and i don't understand why it exist to be honest
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions).Delete all related featuresSo, who uses property semantics? https://dlang.org/spec/function.html#property-functions
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsyou want an assignment of a member run a function for example. I can see that such a thing can be useful in D as well. If property is removed can the same be achieved by other means?
Sep 14 2022
On Wednesday, 14 September 2022 at 21:42:48 UTC, IGotD- wrote:Frankly, if you have to ask, then no, you don't use it. The semantics are pretty subtle.
Sep 14 2022
On 15/09/2022 9:42 AM, IGotD- wrote:No. Getting and setting behavior via a method is not associated with property. https://dlang.org/spec/function.html#property-functions Works: ```d struct Foo { int data() { return m_data; } // read property int data(int value) { return m_data = value; } // write property private: int m_data; } void main() { Foo foo; foo.data = 234; } ```
Sep 14 2022
On 9/14/22 14:50, rikki cattermole wrote:On 15/09/2022 9:42 AM, IGotD- wrote:I think I heard about supporting the following as well, which is currently missing: foo.data++; An exception to that is the .length property of arrays, which is practically a property function with privileges. :) AliNo. Getting and setting behavior via a method is not associated with property. https://dlang.org/spec/function.html#property-functions Works: ```d struct Foo { int data() { return m_data; } // read property int data(int value) { return m_data = value; } // write property private: int m_data; } void main() { Foo foo; foo.data = 234; } ```
Sep 14 2022
On Wednesday, 14 September 2022 at 22:38:34 UTC, Ali Çehreli wrote:I think I heard about supporting the following as well, which is currently missing: foo.data++;Yeah, these and property void delegate() foo() { ... } obj.foo(); // should call the delegate, not be a no-op are the two things I still hold out hope for property to be useful. But it has been like 11 years and it has never worked. I don't expect it ever will.
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language.Please consider "pure". :)It seems everybody agrees that binary literals are not a worthy candidate for removalDon't care.I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsNot me. And if I see one, I remove it. Still, there are 44 property occurence in my whole code base (because stuff get copy-pasted) that I never really wanted there.
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:So, who uses property semantics?I would use ` property` a lot if it was actually useful. ```D struct S { int _x; property int x() const { return _x; } property void x(int value) { _x = value; } } void main() { S s; // Doesn’t work: //s.x += 1; // Neither does this: //s.x++; } ```
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI use it (though in my case, the code would still work the same even without property). Personally, I think it should be kept, because of `ref` properties, that could possibly be used to restrict the value-range of members.
Sep 14 2022
On 15/09/2022 12:34 PM, Ruby The Roobster wrote:I use it (though in my case, the code would still work the same even without property).Okay, so you don't use the semantics provided by property, a UDA would still allow your code to work (see link for semantics)?
Sep 14 2022
On Thursday, 15 September 2022 at 00:38:54 UTC, rikki cattermole wrote:On 15/09/2022 12:34 PM, Ruby The Roobster wrote:I mean that because properties don't take any arguments, such a function could be called using UFCS, and it would act the same as if it were marked property.I use it (though in my case, the code would still work the same even without property).Okay, so you don't use the semantics provided by property, a UDA would still allow your code to work (see link for semantics)?
Sep 14 2022
On 15/09/2022 1:31 PM, Ruby The Roobster wrote:On Thursday, 15 September 2022 at 00:38:54 UTC, rikki cattermole wrote:Okay good good, you are only using the syntax that is what we needed to know, thanks!On 15/09/2022 12:34 PM, Ruby The Roobster wrote:I mean that because properties don't take any arguments, such a function could be called using UFCS, and it would act the same as if it were marked property.I use it (though in my case, the code would still work the same even without property).Okay, so you don't use the semantics provided by property, a UDA would still allow your code to work (see link for semantics)?
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:So, who uses property semantics?How can we use it if it is not implemented? ``` struct S { void opCall() {} void opAssign(S s) {}; } property ref S foo(); foo(); // doesn't do what's expected foo = S(); // same property void delegate() foo(); foo(); // same property ref int foo(); foo++; ``` etc
Sep 14 2022
On Thursday, 15 September 2022 at 05:20:53 UTC, Max Samukha wrote:property ref int foo(); foo++;Without 'ref'
Sep 14 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI use it extensively and have since I can remember for all my projects. Would really hate having to go through all my projects to remove it and fix whatever bugs/errors that will for sure creep up from it.
Sep 15 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI don't, except maybe for consistency with existing code when working on a common codebase with other people. I wouldn't mind it going.
Sep 15 2022
On Wed, Sep 14, 2022 at 07:20:04PM +0000, Rikki Cattermole via Digitalmars-d wrote: [...]So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsNot me. In the past I only did it to satisfy Phobos range APIs, but today Phobos no longer requires property on ranges, so it's basically useless as far as I'm concerned. T -- Marketing: the art of convincing people to pay for what they didn't need before which you fail to deliver after.
Sep 15 2022
On 9/14/22 21:20, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI am pretty sure many (most?) people who rely on those semantics are oblivious to it because property is in third-party code, so not much will come from this thread. Anyway, if you want to break everyone's code over this why not just fix property so it becomes actually useful instead?
Sep 15 2022
On 16/09/2022 6:16 AM, Timon Gehr wrote:Anyway, if you want to break everyone's code over this why not just fix property so it becomes actually useful instead?I don't, but if something has to go... Better it be something that people out right don't intend to use or know what it does do.
Sep 15 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI rarely set out to use property initially however it is very useful as a way to insert (say) logging and debugging scaffolding into other people's code.
Sep 15 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI don’t. Dump it. Replicate VB.NET’s success story with their properties can have parameters; effectively you hook the `obj.propName(args)` and `obj.propName(args) = value` expressions. Also, because it fits a little, add `opCallAssign` and friends to D akin to `opIndexAssign`.
Sep 16 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsHi Rikki, I am not using it. -Ikel
Sep 18 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI do - or I would if only they would work - e.g. if x is a property (having a getter and a setter), ++x should work, &x should be an error etc. If it has only a getter or a setter, ++x should not work, but provide a meaningful error message instead of the garbage we get now. It would be easy to fix this. Makes me really sad.
Sep 26 2022
On 9/26/22 11:50, Dom DiSc wrote:if x is a property (having a getter and a setter), ++x should workThat came up a couple of times on this thread. Sounds easy to my ears. Is there a blocker for the implementation? Ali
Sep 26 2022
On Monday, 26 September 2022 at 18:51:41 UTC, Ali Çehreli wrote:On 9/26/22 11:50, Dom DiSc wrote:I don't think so. Would be an easy lowering. Forbidding to take the address is more controversial, but I don't understand why. It would be ambiguous (should it return a value-pointer or a function-pointer?). If you want something you can take the address of, make it a function or a value, not a property.if x is a property (having a getter and a setter), ++x should workThat came up a couple of times on this thread. Sounds easy to my ears. Is there a blocker for the implementation? Ali
Sep 26 2022
On Monday, 26 September 2022 at 18:51:41 UTC, Ali Çehreli wrote:On 9/26/22 11:50, Dom DiSc wrote:A nested struct can do this, but each field needs a new build. For example to `Inner z` in code: ```d template foo(T) { struct Inner { T bar; alias bar this; auto opUnary(string op)() if(op == "++") { ++bar; return this; } } Inner z; } struct Outer(T) { T X, Y; mixin foo!T s; alias z = s.z; auto x() { return X; } auto x(T n) { return X = n; } auto y() { return Y; } auto y(T n) { return Y = n; } } import std.stdio; void main() { auto outer = Outer!int(); with(outer) { x = 320; y = 240; z = 160; z++; writefln!"x = %s, y = %s, z = %s" (x, y, z); // x = 320, y = 240, z = 161 } } ``` SDB 79if x is a property (having a getter and a setter), ++x should workThat came up a couple of times on this thread. Sounds easy to my ears. Is there a blocker for the implementation? Ali
Sep 28 2022
On 26.09.22 20:50, Dom DiSc wrote:On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Also see: https://wiki.dlang.org/DIP24Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsI do - or I would if only they would work - e.g. if x is a property (having a getter and a setter), ++x should work, &x should be an error etc. If it has only a getter or a setter, ++x should not work, but provide a meaningful error message instead of the garbage we get now. It would be easy to fix this. Makes me really sad.
Sep 26 2022
I'm using property a lot of places, in the hope that one day it would receive a full set of useful semantics - and also as a way to add a distinction between "verb" functions and simple getters/setters. There are also definitely some places where the current semantics are in effect. IMO, the possible `writeln = "foo";` syntax, on the other hand, results in rather surprising semantics, and if that wouldn't result in a ton of breakage, I'd rather see that gone.
Sep 28 2022
On Wednesday, 28 September 2022 at 18:47:24 UTC, Sönke Ludwig wrote:I'm using property a lot of places, in the hope that one day it would receive a full set of useful semantics – and also as a way to add a distinction between "verb" functions and simple getters/setters. There are also definitely some places where the current semantics are in effect.With other words, you’re setting yourself up to have your code broken.
Sep 29 2022
On Thursday, 29 September 2022 at 08:40:11 UTC, Quirin Schroll wrote:On Wednesday, 28 September 2022 at 18:47:24 UTC, Sönke Ludwig wrote:Well, sort of. But in hope to get something more useful as it is now. But what a suggestive question! You either don't use properties so the feature is useless and can be thrown away, or you use them and then be blamed to shoot yourself into your foot.I'm using property a lot of places, in the hope that one day it would receive a full set of useful semantics – and also as a way to add a distinction between "verb" functions and simple getters/setters. There are also definitely some places where the current semantics are in effect.With other words, you’re setting yourself up to have your code broken.
Sep 29 2022
On Thursday, 29 September 2022 at 11:53:56 UTC, Dom DiSc wrote:On Thursday, 29 September 2022 at 08:40:11 UTC, Quirin Schroll wrote:To be fair, the language spec does recommend **not** using itOn Wednesday, 28 September 2022 at 18:47:24 UTC, Sönke Ludwig wrote:Well, sort of. But in hope to get something more useful as it is now. But what a suggestive question! You either don't use properties so the feature is useless and can be thrown away, or you use them and then be blamed to shoot yourself into your foot.[...]With other words, you’re setting yourself up to have your code broken.WARNING: The definition and usefulness of property functions is being reviewed, and the implementation is currently incomplete. Using property functions is not recommended until the definition is more certain and implementation more mature.https://dlang.org/spec/function.html#property-functions
Sep 29 2022
On Friday, 30 September 2022 at 03:20:31 UTC, Tejas wrote:To be fair, the language spec does recommend **not** using itInterestingly, Phobos is full of them. For example, if you are using Appender, your path goes through property. 😀 SDB 79WARNING: The definition and usefulness of property functions is being reviewed, and the implementation is currently incomplete. Using property functions is not recommended until the definition is more certain and implementation more mature.https://dlang.org/spec/function.html#property-functions
Sep 29 2022
On Thursday, 29 September 2022 at 08:40:11 UTC, Quirin Schroll wrote:On Wednesday, 28 September 2022 at 18:47:24 UTC, Sönke Ludwig wrote:No problem for a code gunslinger. Well, we can clean up easily without writing a new parser. 😀 By the way, I use it occasionally. .. SDB 78I'm using property a lot of places, in the hope that one day it would receive a full set of useful semantics – and also as a way to add a distinction between "verb" functions and simple getters/setters. There are also definitely some places where the current semantics are in effect.With other words, you’re setting yourself up to have your code broken.
Sep 29 2022
On Friday, 30 September 2022 at 13:30:31 UTC, razyk wrote:What ' property' gains or should gain over '// property'?It gives you control over the access to a member - you can read it (if there is a getter) - you can write it (if there is a setter) - you can apply operations on it that both read and write it (like ++ if there is both a getter and a setter) - you cannot get its address (use function or variable if you want this) - property allows you to calculate the requested value instead of storing it somewhere. But you can't get the address of a calculation (what should that be? The address of some temporary storage? A pointer to the stack? A pointer to the function that performs the calculation? But which one? The getter or the setter? None of those makes any sense)
Oct 01 2022
On 02/10/2022 3:12 AM, Dom DiSc wrote:On Friday, 30 September 2022 at 13:30:31 UTC, razyk wrote:Important to note that none of these things actually apply to property.What ' property' gains or should gain over '// property'?It gives you control over the access to a member - you can read it (if there is a getter) - you can write it (if there is a setter) - you can apply operations on it that both read and write it (like ++ if there is both a getter and a setter) - you cannot get its address (use function or variable if you want this)
Oct 01 2022
On Saturday, 1 October 2022 at 16:50:24 UTC, rikki cattermole wrote:On 02/10/2022 3:12 AM, Dom DiSc wrote:Yup. But the question was what it SHOULD gain over a pure comment. And the above is what I expect it to provide.On Friday, 30 September 2022 at 13:30:31 UTC, razyk wrote:Important to note that none of these things actually apply to property.What ' property' gains or should gain over '// property'?It gives you control over the access to a member - you can read it (if there is a getter) - you can write it (if there is a setter) - you can apply operations on it that both read and write it (like ++ if there is both a getter and a setter) - you cannot get its address (use function or variable if you want this)
Oct 01 2022
On Saturday, 1 October 2022 at 16:50:24 UTC, rikki cattermole wrote:On 02/10/2022 3:12 AM, Dom DiSc wrote:More specifically, all of these things kinda apply but kinda not to all function, property or not.On Friday, 30 September 2022 at 13:30:31 UTC, razyk wrote:Important to note that none of these things actually apply to property.What ' property' gains or should gain over '// property'?It gives you control over the access to a member - you can read it (if there is a getter) - you can write it (if there is a setter) - you can apply operations on it that both read and write it (like ++ if there is both a getter and a setter) - you cannot get its address (use function or variable if you want this)
Oct 01 2022
On Wednesday, 14 September 2022 at 19:20:04 UTC, Rikki Cattermole wrote:Recently Walter has been wanting to remove language features that don't need to be kept to simplify the language. It seems everybody agrees that binary literals are not a worthy candidate for removal, but one thing that I kept thinking about was property. As far as I know, hardly anyone actually uses its semantic behaviors, and the ones that it does have which are incomplete are special cases that don't benefit us all that much. I was going to post this yesterday, but it turns out I am not alone in thinking this can be removed safely (can be swapped to a UDA to prevent code breakage without any language additions). So, who uses property semantics? https://dlang.org/spec/function.html#property-functionsCan we fix instead? The current situation is ripped with problems.
Sep 30 2022
On 9/30/2022 6:22 PM, deadalnix wrote:Can we fix instead? The current situation is ripped with problems.Make a proposal.
Oct 01 2022
On 10/1/22 21:00, Walter Bright wrote:On 9/30/2022 6:22 PM, deadalnix wrote:https://wiki.dlang.org/DIP24Can we fix instead? The current situation is ripped with problems.Make a proposal.
Oct 01 2022
On 02.10.22 00:40, Timon Gehr wrote:https://wiki.dlang.org/DIP24Diferentiate "property function" and "plain function", why? Just litle bet more cognitive burden.
Oct 01 2022
On 10/2/22 02:05, razyk wrote:On 02.10.22 00:40, Timon Gehr wrote:Because there should be a way to reliably replace fields by functions without refactoring the entire code base.https://wiki.dlang.org/DIP24Diferentiate "property function" and "plain function", why?Just litle bet more cognitive burden.The feature has been pretty successful in other languages.
Oct 01 2022
On 02.10.22 02:17, Timon Gehr wrote:Because there should be a way to reliably replace fields by functions without refactoring the entire code base.A long time ago D fully support that with more general rule.
Oct 01 2022
On 10/2/22 02:44, razyk wrote:On 02.10.22 02:17, Timon Gehr wrote:No, and there is no way to make it work.Because there should be a way to reliably replace fields by functions without refactoring the entire code base.A long time ago D fully support that with more general rule.
Oct 01 2022
On Sunday, 2 October 2022 at 00:05:58 UTC, razyk wrote:On 02.10.22 00:40, Timon Gehr wrote:Current behavior is significantly more complex than what Timon proposed in DIP24, ad overall complexity would have been greatly reduced if adopted at the time instead of something that kinda does both but not really as we have today. It's never too late to realize a mistake has been made.https://wiki.dlang.org/DIP24Diferentiate "property function" and "plain function", why? Just litle bet more cognitive burden.
Oct 01 2022
On Saturday, 1 October 2022 at 19:00:13 UTC, Walter Bright wrote:On 9/30/2022 6:22 PM, deadalnix wrote:Timon did like 10 years ago.Can we fix instead? The current situation is ripped with problems.Make a proposal.
Oct 01 2022