At Fri, 6 Sep 2002 21:49:54 +0900,
Jan Arne Petersen wrote:
> > Already we have autoload, and it can be considered a special
> > form of const_missing, I guess.
>
> The problem with autload is that you have to register the name of the
> constants first and you cannot call a proc on request but only 'require'
> a specific file.
> 
> In contrast 'const_missing' can be used to create classes on demand if
> you don't know the name before it is requested and you can execute any
> code in the 'const_missing' method.

I thought this problem again last night.  Then I got believed that
const_missing is superior option.

  * autoload can be defined by const_missing but the coverse cannot. 
    So we can exile autoload from built-ins.  
  * attr_missing looks quite different matter, as Dave said.  

But I have a question about const_missing spec. 

  module M
    class<<self
      def const_missing(a) a end
      def method_missing(*a) a end
    end
  end 
  p M::M

In this case, what should be printed?

  (1) :M   by const_missing()
  (2) [:M] by method_missing()
  (3) M    by the rule M == M::M


-- Gotoken