On 4/30/07, Gary Wright <gwtmp01 / mac.com> wrote:
>
> On Apr 30, 2007, at 11:10 AM, Brian Guthrie wrote:
> > The Handshake library surrounds an object that includes the
> > appropriate module with a proxy object and checks everything that
> > passes across that barrier.  That means that I can easily manipulate
> > any incoming Proc objects, extending the instance so that Proc#call is
> > required to check an argument list.  The problem is that changing the
> > behavior of Proc#call does _not_ affect the behavior of yield:
>
> The 'yield' mechanism is not a method call and so you won't be able
> to intercept it by redefining methods.  You would have to hack on the
> Ruby interpreter itself.
>
> I'll admit to be pretty leary of something that redefines Proc#call
> at the class level (vs. via singleton methods on particular procs).
>
> Gary Wright
>

Indeed.  The example I gave did that for simplicity's sake but the
library would only modify the incoming objects.

It's the sort of library that shouldn't necessarily be used in
production code anyway, though, due to the performance hit you take
from having to run each and every single method call through a filter.

Brian