Let's not. Hair splitting actually came up in reference to the
distinction between the first two examples, and not in reference to the
third.
Actually, if you go back and read David's post [ruby-talk:205331],
which is the first reference to hair splitting in this thread, you'll
see that he clearly believes both of the first two examples to be
closures. When he mentions hair splitting, it's directly in relation
to the third form -- an unconverted (yielded to) block.
If you're calling the distinction for the third example "hair
splitting", I'm just going to have to call you flat-out "wrong"
Did you read my explanation? I called it hair-splitting for the same
reason David did -- because it can be argued both ways. I gave both
reasons. If you want to debate that point, please reply with more
specifics.
unless this is a case of "the Ruby community uses a definition of 'closure'
that is in direct contradiction of other definitions of 'closure'"
I'll repeat myself: "Since the environment is never stored, it's not
really a closure *in the implementation*. This is the hair that David
was splitting.
"But semantically, whether a block is converted to a proc or just
yielded to, the behavior regarding variable scope is identical; so if
one is a closure, it's useful to refer to the other as a closure as
well, even if it's not implemented as a true closure. In this sense,
all blocks are closures."
As you can see, I've admitted that in the *one* case of a
non-converted block it is not a true closure. But I believe semantic
terms can be more useful than rigid and narrowly defined formal
theoretical definitions. Like duck typing -- as long as it quacks just
like a real closure, it's close enough for me.
Jacob Fugal
[ruby-talk:205331]
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/205331