Hi,

Am Fre, 2002-09-06 um 13.17 schrieb nobu.nokada / softhome.net:
> Hi,
> 
> At Fri, 6 Sep 2002 10:23:50 +0900,
> Yukihiro Matsumoto wrote:
> > |I wrote a patch to add a Module#const_missing method like the 
> > |Object#method_missing method to Ruby.
> > 
> > Thank you for the patch.  But we have to discuss whether we need this
> > hook.  Hook is sometimes useful but since we can not add every
> > possible hook, we have to draw line somewhere.  Opinion, everyone?
> 
> 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.


Jan Arne Petersen