>>165 やっつけですが、Squeak Smalltalk で。
Object >> inc
| sender index |
sender := thisContext sender.
index := (sender method at: sender pc - 2) \\ 16 + 1.
^sender tempAt: index put: (sender tempAt: index) + 1
| a b before after |
a:= 1. b := 2.
before := {a. b}.
a inc. b inc.
after := {a. b}.
^{before. after} "=> #(#(1 2) #(2 3)) "