I have read this blog entry by Jay quite a few times, each time saying to myself, "Yep, understood that." And yes, I do understand... but then later on I find myself unable to recall exactly what I understood.
Hence, as I read that entry yet again, I'm attempting to jot down exactly what I'm understanding...
In Rails, you'll find code like this every once in a while:
area_codes = phone_numbers.collect &:area_code
What's happening here?
class Symbol def to_proc Proc.new { |*args| args.shift.__send__(self, *args) } end end
Note that in the above code, args.shift represents an element of the array, sent by collect.
The rest should make sense on its own now.
Hopefully this writing exercise will help my memory serve better.