From: "trans. (T. Onoma)" Date: 2004-10-13T02:17:01+09:00 Subject: Re: closure's self On Tuesday 12 October 2004 11:49 am, Robert Klemme wrote: | Why do you need that?  You *know* the arity because you define the | argument list between ||. and On Tuesday 12 October 2004 12:04 pm, Ara.T.Howard@noaa.gov wrote: | like this? | |    harp:~ > irb |    irb(main):001:0> cb = proc{|a,b,c| cb.arity} |    => # | |    irb(main):002:0> p cb.call(0,1,2) |    3 |    => nil Well, my example was maybe too simplistic. Procs can be passed around, so, no, you don't always have a "handle" on them. Moreover, 'this' refers to the block actually, not really the Proc. It seems I got my scope wrong, though. But I'm not sure what this scope is yet. I should also point out that this idea further derives from speculation (over on suby-ruby) about internalized counters for #each blocks (and maybe a last? and first?) eg- ["a","b","c"].each { |x| p this.counter, x } => 0 "a" 1 "b" 2 "c" but I want to focus on the block initself first --hence it's arity. T.