Hi,

In message "[ruby-talk:00672] Re: Way to intercept method calls?"
    on 99/08/17, clemens.hintze / alcatel.de <clemens.hintze / alcatel.de> writes:

|> Hmm, there's no such mechanism to capture all method calls in current
|> Ruby, and I'm afraid it will not be available in the future, because
|> it should cause performance drawback.
|
|Hmm... We could have a method, that could set an internal flag on C
|level. If that flag is set for a certain class, ruby could call
|`__send__with `midĽ¨ instead of sending direct. But only for that
|class (means instances)!
|
|Would that be better for the performance?

Yes.  I assume the cost of one additional condtional check can be
ignored.  But two things:

  * I'm not sure whether it's worthy enough.  I'm afraid not.
  * We don't have spare flagspace anymore in current implementation.

|> Instead, there's a way to override all predefined methods dynamically,
|> which is not exactly you want, since it can't handle dynamically
|> defined methods, but I guess it will do most of the job.
|
|But that would also cause performance drawbacks, wouldn it?

Well, at least it doesn't hurt the performance of unrelated objects.

                                                        matz.