"Tom Sawyer" <transami / transami.net> wrote in
....
 > in self reference which points to the object, self_parent would point to

Normally I not that picky about names but ``self_parent'' , especially
in combination with your example, seems to be a rather misleading
term.

....
> class S
>   def initialize
>     self_parent.hello
>   end
> end
>
> class P
>   def initialize
>     @s = S.new
>   end
>   def hello
>     p "hello world"
>   end
> end
....

Have you tried implementing this in pure Ruby -  is

---
class S
    def initialize(calling_self)
        calling_self.hello
    end
end

class P
    def initialize
        @x = S.new self
    end
    def hello
       p "hello World"
    end
end
---

short enough?


/Christoph