On Wed, Aug 02, 2006 at 05:19:38AM +0900, Jacob Fugal wrote:
> On 8/1/06, Chad Perrin <perrin / apotheon.com> wrote:
> >On Wed, Aug 02, 2006 at 04:56:53AM +0900, Jacob Fugal wrote:
> >> On 8/1/06, Chad Perrin <perrin / apotheon.com> wrote:
> >> >Specifically, it sounds like what you're saying here would indicate that
> >> >this is a closure:
> >> >
> >> >  def foo
> >> >    bar = 0
> >> >    lambda { puts bar += 1 }
> >> >  end
> >> >
> >> >  baz = foo
> >> >
> >> >and this is a closure:
> >> >
> >> >  def foo
> >> >    lambda { puts "Hellow world!" }
> >> >  end
> >> >
> >> >  bar = foo
> >>
> >> Yes, this is exactly the point we've been trying to get across. Both
> >> of these are closures.
> >>
> >> >but this is not a closure:
> >> >
> >> >  foo = 0
> >> >
> >> >  foo.each do
> >> >    puts bar += 1
> >> >  end
> >>
> >> This is where we get into what David Black described as hair
> >> splitting. Lets move away from each, and to a set of more general
> >> methods:
> >
> >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.

You were right, up to the point where you said "When he mentions hair
splitting".  The problem at that point that prompted him to mention hair
splitting was the fact that I was balking at defining that second
example as a "closure".  I've now come to the conclusion that the second
example is a closure according to at least some, valid from a given
perspective, interpretations of the meaning of "closure".  Thus, I quit
splitting that hair and said "Okay, so I'll stipulate that the second
example can be called a closure, depending on interpretation."


> 
> >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.

See above.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"The ability to quote is a serviceable
substitute for wit." - W. Somerset Maugham