It's called a closure. PackedScannableParameter and theFarm are "hoisted" variables. Basically, a class is generated behind the scenes that has a reference back to those two variables. It's nothing you couldn't write by hand if you so desired (and had plenty of time )