The (Hypothetical) Dot Equals Assignment Operator

What if languages had a .= operator? What would it do?

To me, this operator looks analogous to other assignment operators like +=, -=, *=, /=, etc. So instead of

person = person.withAge(42);

you could write

person .= withAge(42);

But how often does this situation really happen? About as often as you need to use +=, -= or any of the other existing operation/assignment operators, in my opinion.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s