Somehow I ended up a binary assignment with the zip operator:
$giver<wallet given> Z+= (-$amount, $amount)
I was playing around with a simulation problem from Uri Wilensky (R’s
gganimate is pretty cool, and pretty and cool).
That’s the same thing as writing out both sides:
$giver<wallet given> = $giver<wallet given> Z+ ( -$amount, $amount )
But, I also could have used a hyper here:
$giver<wallet given> >>+=<< ( -$amount, $amount )
I’ve longed wished for this sort of thing in Perl 5, and I think I’ve strained various unmaintainable kludges to get it. Even these Perl 6 expressions might be too mind bending for the work-a-day maintainer.
And, for what it’s worth, the results are pretty much what I expected despite the those Ph.D.s guessing incorrectly. But then, I also have a statistical thermodynamics book with arm’s reach of my keyboard. A closed system with a fixed number of particles and a fixed amount of energy where particles can transfer energy to other particles is a type of Spherical Cow. The system can exist in any of its microstates. Particle identity aside, some distributions of energy are more probable. The one that everyone might guess, that all particles will have the close to the same energy, just isn’t that likely. But, this isn’t a physics blog.