I'd written the statement 'block parameters are assigned to when the
block is invoked', and then thought "hmm. I wonder if anything that is
assignable can appear as a block parameter?"
Low and behold:
class Silly
def fred=(val)
puts "Assigning #{val}"
end
end
s = Silly.new
1.upto(5) { |s.fred| }
produces
Assigning 1
Assigning 2
Assigning 3
Assigning 4
Assigning 5
Got to love it when something turns out to be orthogonal like that!
Dave