Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Operation assignment (.= assignment operator) #1

@staa99

Description

@staa99

Hi everyone,

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions