From: Markus Date: 2004-10-13T02:24:25+09:00 Subject: Re: closure's self On Tue, 2004-10-12 at 10:14, Mikael Brockman wrote: > Markus writes: > > > On Tue, 2004-10-12 at 09:00, Mikael Brockman wrote: > > > "trans. (T. Onoma)" writes: > > > > > > > Curious thought --- what if I'd like to know the arity of the proc being > > > > executed? > > > > > > > > proc{|x| arity }.call(1) > > > > > > > > I see no way to do this, not even with the extended Binding class. I begin to > > > > wonder (for this and other reasons) if a closure's "self" is doable? (at > > > > least I think _closure_ is the right "scope" for this) > > > > > > > > proc{|x| this.arity }.call(1) > > > > > > > > > Closures per se don't have selfs -- they're not objects. Consider > > > > Ah, but they are Objects (as you make use of below). It's just > > that the binding used when their body is called that of their creation, > > not of themselves. > > Proc objects contain closures, but they *are* not closures. :-) Point taken. I'd like to respond but I don't think my knife is sharp enough to split the hair any finer than that without cutting myself. If I were socrates, I might be tempted to ask "BTW, what is this "closure" that a Proc contains?" but I think I can see where that leads. -- Markus