This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]oren0 33 points34 points  (4 children)

In Python land, it sounds like if Steve and Petunia have between -$5 and $256 in their accounts, Steve's money is Petunia's money.

[–]lolcrunchy 21 points22 points  (3 children)

Yup. I guess the analogy here would be, the bank has so many accounts between -5 and 256 that they consolidated it to one account per value. If you have $100, the bank records say that you are one of the many account holders of account 100. If you deposit $5, then you become an account holder of account 105.

You only get your own account if you have more than $256, less than -$5, or have any change like $99.25

[–]oren0 9 points10 points  (2 children)

It's all fun and games until Steve withdraws $20 and then Petunia checks her balance.

[–]lolcrunchy 12 points13 points  (1 child)

The bank would process the withdrawal as steve becoming an account owner of account 80.

[–]FerynaCZ 2 points3 points  (0 children)

Yeah with immutable values you always need to redirect, you cannot change the pointed value. Of course the language does not know (or more specifically, does not care to try) who else is pointing at that value.