See the Solution and Explanation.

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 11 months ago (2 children)

As I would expect. Does the result surprise people?

If so, rename the arguments to fun() to be r, s, t, and u. Just inside the function. Does the obvious two scopes now make it clearer?

  • source
  • hideshow 4 child comments
  • [–] 7 points 11 months ago (2 children)
  • [–] 2 points 11 months ago

    To be fair, I had to read the linked question on SO to understand what was the possible alternative. I do expect that if I use += it is in place.

    On the other hand with Python and Java I always keep forgetting if everything is by value or by reference, I really miss some extra clarity of the languages where you can see if something is mutable when passed to a function

  • source
  • parent
  • [–] 3 points 11 months ago (2 children)

    Looks like this whole post is an ad for someone's project. The links hardly have to do with the post.

  • source
  • parent
  • hideshow 4 child comments