On 10 ον, 11:53, Matthias Wächter <matth... / waechter.wiz.at> wrote:
> On 09.06.2011 20:40, Ilias Lazaridis wrote:
>
> > class String
> >  alias_method :orig_initialize, :initialize
> >  def initialize(val)
> >   orig_initialize "OBSERVED: " + val

#change to something like:

    orig_initialize val
    puts self.inspect

> >  end
> >  def my_method_test
> >   print self.inspect, " test\n"
> >  end
> > end
[...]

> If that really had worked the way you¡Çd expect it, you had ended up in an endless loop running out of stack levels soon. The reason for thiss that
[...] - (elaborations of recursion problems with current showcase)

I've understood your elaborations.

You should not focus on the showcase code, which could be easily
rewritten to not fall into this "trap" at all (e.g. placing a simple
"puts object.inspect" in the constructor).

Please see the reply to Mr. Matsumoto for more details on the essence
of this issue (and the general essence subjecting development).

> As you see from the above, it¡Çs not just a trade-off for performance reasons.

The performance problem is the central one. Everything else comes
after, and should be solvable easily.

> > Underlying Requirement:
> > Ability to track instantiation of every object within the system.
>
> This is an interesting idea. I think you have to patch NEWOBJ() in the sources, at least.

Is "NEWOBJ()" the central function, used system-wide (even from the
parser)?

.

--
http://lazaridis.com