You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 21, 2023. It is now read-only.
I have run a web search trying to find out whether this feature already exists or if there's some discussion around it. However, I couldn't find anything. As a result, I'd love to submit a request to add compound operation assignment to c#. Unfortunately, I don't know of any languages that already support this feature and I understand that this might be as a result of certain complications.
Basically, what this feature represents is this:
value = value.operate()
// is equivalent to
value .= operate()
// where operate returns the same type as value.
A common use-case is in LINQ queries, when you might have this or some equivalent
enumerable = enumerable.Where(condition);
This can then be replaced by
enumerable .= Where(condition);
This use-case is very common and I believe this feature increases code clarity and reduces amount of code written, therefore improving developer productivity.