Hi,

In message "Re: About 1.9 #__method__ feature."
    on Tue, 4 Jul 2006 02:07:30 +0900, transfire / gmail.com writes:

|No problem. I will try to paint better picture. I have variant of
|OpenStruct called OpenObject:
|
|  class OpenObject < BasicObject #(this is my BasicObject like
|BlankSlate)
|    ...
|
|Using BasicObject as parent removes (almost) all kernel methods which
|ensures no name clashes when using the OpenObject. Problem is sometimes
|those removed methods are needed. So the important ones are available
|by shadow methods, like __send__ even though #send is removed. Problem
|is A) how many and which kernel methods should be shadowed; all of
|them? and worse B) it means users have to be aware when a subclass of
|BasicObject might be used and call the LCD, ie. shadow methods instead
|of regular methods.

I don't know what you expect for BasicObject and OpenObject.
BasicObject is a BasicObject what it is.  Could you describe what you
want and what you expect first please?  BasicObject may not be the
answer for your problem.  If it's not the right answer, tweaking it to
adopt your requirement might not be a good idea.

|I came up with one idea that fixes A. using  #__self__, eg.
|
|  o = OpenObject.new
|  o.class #=> nil
|  o.__self__.class  #=> OpenObject

What does this __self__ do?

|What were the sticking points?

Separating it would break Ruby's object model.  It would make it much
more complex at least, far more complex than I can bear.

|I spent some time considering this and
|arrived at a conception of layers, almost like subclassing, eg
|MyClass:Public < MyClass:Private.

?  Sorry, I don't get it.

							matz.