3 ms·
I don't know anything about the language but the first form suggests immutability (return a new point with the y property = to value), the second looks like mut
by emmanueloga_ 8y ago
I don't know anything about the language but the first form suggests immutability (return a new point with the y property = to value), the second looks like mutating a struct
- garmaine 8y agoI don't see anything intrinsically different about the two. If anything the established notation of mathematics for hundreds of years is that '=' implies immutability.
- titanomachy 8y agoThe second example suggests to me that `point` already exists, and we're mutating it by changing the value of its `y` property.