www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Poll: do you use property semantics?

reply Rikki Cattermole <alphaglosined gmail.com> writes:
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
next sibling parent Daniel N <no public.email> writes:
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-functions
Not using.
Sep 14 2022
prev sibling next sibling parent ryuukk_ <ryuukk.dev gmail.com> writes:
I don't use it, and i don't understand why it exist to be honest
Sep 14 2022
prev sibling next sibling parent monkyyy <crazymonkyyy gmail.com> writes:
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 features
 So, who uses  property semantics?

 https://dlang.org/spec/function.html#property-functions
Sep 14 2022
prev sibling next sibling parent reply IGotD- <nise nise.com> writes:
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-functions
you 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
next sibling parent Adam D Ruppe <destructionator gmail.com> writes:
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
prev sibling parent reply rikki cattermole <rikki cattermole.co.nz> writes:
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
parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 9/14/22 14:50, rikki cattermole wrote:
 
 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; } ```
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. :) Ali
Sep 14 2022
parent Adam D Ruppe <destructionator gmail.com> writes:
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
prev sibling next sibling parent Guillaume Piolat <first.last spam.org> writes:
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 removal
Don'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-functions
Not 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
prev sibling next sibling parent Ogi <ogion.art gmail.com> writes:
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
prev sibling next sibling parent reply Ruby The Roobster <rubytheroobster yandex.com> writes:
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-functions
I 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
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
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
parent reply Ruby The Roobster <rubytheroobster yandex.com> writes:
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 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)?
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.
Sep 14 2022
parent rikki cattermole <rikki cattermole.co.nz> writes:
On 15/09/2022 1:31 PM, Ruby The Roobster wrote:
 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 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)?
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.
Okay good good, you are only using the syntax that is what we needed to know, thanks!
Sep 14 2022
prev sibling next sibling parent reply Max Samukha <maxsamukha gmail.com> writes:
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
parent Max Samukha <maxsamukha gmail.com> writes:
On Thursday, 15 September 2022 at 05:20:53 UTC, Max Samukha wrote:

  property ref int foo();
 foo++;
Without 'ref'
Sep 14 2022
prev sibling next sibling parent bauss <jacobbauss gmail.com> writes:
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-functions
I 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
prev sibling next sibling parent Dukc <ajieskola gmail.com> writes:
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-functions
I 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
prev sibling next sibling parent "H. S. Teoh" <hsteoh qfbox.info> writes:
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-functions
Not 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
prev sibling next sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
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-functions
I 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
parent rikki cattermole <rikki cattermole.co.nz> writes:
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
prev sibling next sibling parent max haughton <maxhaton gmail.com> writes:
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-functions
I 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
prev sibling next sibling parent Quirin Schroll <qs.il.paperinik gmail.com> writes:
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-functions
I 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
prev sibling next sibling parent Olivier Pisano <olivier.pisano laposte.net> writes:
No, I don't use  property at all.
Sep 17 2022
prev sibling next sibling parent ikelaiah <iwan.kelaiah gmail.com> writes:
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-functions
Hi Rikki, I am not using it. -Ikel
Sep 18 2022
prev sibling next sibling parent reply Dom DiSc <dominikus scherkl.de> writes:
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-functions
I 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
next sibling parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 9/26/22 11:50, Dom DiSc wrote:

 if x is a property
 (having a getter and a setter), ++x should work
That 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
next sibling parent Dom DiSc <dominikus scherkl.de> writes:
On Monday, 26 September 2022 at 18:51:41 UTC, Ali Çehreli wrote:
 On 9/26/22 11:50, Dom DiSc wrote:

 if x is a property
 (having a getter and a setter), ++x should work
That came up a couple of times on this thread. Sounds easy to my ears. Is there a blocker for the implementation? Ali
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.
Sep 26 2022
prev sibling parent Salih Dincer <salihdb hotmail.com> writes:
On Monday, 26 September 2022 at 18:51:41 UTC, Ali Çehreli wrote:
 On 9/26/22 11:50, Dom DiSc wrote:

 if x is a property
 (having a getter and a setter), ++x should work
That came up a couple of times on this thread. Sounds easy to my ears. Is there a blocker for the implementation? Ali
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 79
Sep 28 2022
prev sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On 26.09.22 20:50, Dom DiSc wrote:
 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-functions
I 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.
Also see: https://wiki.dlang.org/DIP24
Sep 26 2022
prev sibling next sibling parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
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
parent reply Quirin Schroll <qs.il.paperinik gmail.com> writes:
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
next sibling parent reply Dom DiSc <dominikus scherkl.de> writes:
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:
 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.
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.
Sep 29 2022
parent reply Tejas <notrealemail gmail.com> writes:
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:
 On Wednesday, 28 September 2022 at 18:47:24 UTC, Sönke Ludwig 
 wrote:
 [...]
With other words, you’re setting yourself up to have your code broken.
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.
To be fair, the language spec does recommend **not** using it
 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
parent Salih Dincer <salihdb hotmail.com> writes:
On Friday, 30 September 2022 at 03:20:31 UTC, Tejas wrote:
 To be fair, the language spec does recommend **not** using it

 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
Interestingly, Phobos is full of them. For example, if you are using Appender, your path goes through property. 😀 SDB 79
Sep 29 2022
prev sibling parent Salih Dincer <salihdb hotmail.com> writes:
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:
 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.
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 78
Sep 29 2022
prev sibling next sibling parent reply razyk <user home.org> writes:
What ' property' gains or should gain over '// property'?
Sep 30 2022
parent reply Dom DiSc <dominikus scherkl.de> writes:
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
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 02/10/2022 3:12 AM, Dom DiSc wrote:
 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)
Important to note that none of these things actually apply to property.
Oct 01 2022
next sibling parent Dom DiSc <dominikus scherkl.de> writes:
On Saturday, 1 October 2022 at 16:50:24 UTC, rikki cattermole 
wrote:
 On 02/10/2022 3:12 AM, Dom DiSc wrote:
 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)
Important to note that none of these things actually apply to property.
Yup. But the question was what it SHOULD gain over a pure comment. And the above is what I expect it to provide.
Oct 01 2022
prev sibling parent deadalnix <deadalnix gmail.com> writes:
On Saturday, 1 October 2022 at 16:50:24 UTC, rikki cattermole 
wrote:
 On 02/10/2022 3:12 AM, Dom DiSc wrote:
 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)
Important to note that none of these things actually apply to property.
More specifically, all of these things kinda apply but kinda not to all function, property or not.
Oct 01 2022
prev sibling parent reply deadalnix <deadalnix gmail.com> writes:
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-functions
Can we fix instead? The current situation is ripped with problems.
Sep 30 2022
parent reply Walter Bright <newshound2 digitalmars.com> writes:
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
next sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 10/1/22 21:00, Walter Bright wrote:
 On 9/30/2022 6:22 PM, deadalnix wrote:
 Can we fix instead?

 The current situation is ripped with problems.
Make a proposal.
https://wiki.dlang.org/DIP24
Oct 01 2022
parent reply razyk <user home.org> writes:
On 02.10.22 00:40, Timon Gehr wrote:

 https://wiki.dlang.org/DIP24
Diferentiate "property function" and "plain function", why? Just litle bet more cognitive burden.
Oct 01 2022
next sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 10/2/22 02:05, razyk wrote:
 On 02.10.22 00:40, Timon Gehr wrote:
 
 https://wiki.dlang.org/DIP24
Diferentiate "property function" and "plain function", why?
Because there should be a way to reliably replace fields by functions without refactoring the entire code base.
 Just litle bet more cognitive burden.
 
The feature has been pretty successful in other languages.
Oct 01 2022
parent reply razyk <user home.org> writes:
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
parent Timon Gehr <timon.gehr gmx.ch> writes:
On 10/2/22 02:44, razyk wrote:
 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.
No, and there is no way to make it work.
Oct 01 2022
prev sibling parent deadalnix <deadalnix gmail.com> writes:
On Sunday, 2 October 2022 at 00:05:58 UTC, razyk wrote:
 On 02.10.22 00:40, Timon Gehr wrote:

 https://wiki.dlang.org/DIP24
Diferentiate "property function" and "plain function", why? Just litle bet more cognitive burden.
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.
Oct 01 2022
prev sibling parent deadalnix <deadalnix gmail.com> writes:
On Saturday, 1 October 2022 at 19:00:13 UTC, Walter Bright wrote:
 On 9/30/2022 6:22 PM, deadalnix wrote:
 Can we fix instead?
 
 The current situation is ripped with problems.
Make a proposal.
Timon did like 10 years ago.
Oct 01 2022