From: mental@... Date: 2005-11-03T02:18:14+09:00 Subject: Re: Anonymous methods, blocks etc. (Cont. 'default block params') Quoting Trans : > You are right in that there is a caveat for having this in that > you need to know that they are going to be "anonymous methods" > in order to pass them around. But the same is true for calling a > proc, i.e. you have to know it's a proc to call it. Actually, no, you just need to know it's a Callable. Or duck-typed like one. Could be a continuation, or a proc, or some proxy object I just invented. I find that to be a very, very valuable property. > def proxy(a) > if lambda? a > actual(->a) > else > actual(a) > end > end Try: def proxy(a) if respond_to? :call actual(->a) else actual(a) end end If we do this, -> ought to work on anything that understands :call. -mental