Hello,

2011/5/30 Xavier Shay <xavier-list / rhnh.net>:
>> - Please try to minimize a patch.
>> =A0 - It would be good to use the existing code as possible as you can.
> I realise this would be ideal, but I can't figure out how it works, or wh=
ether it would be compatible with the new algorithm.

Indeed, load.c is very complex, but I believe that this is because
load.c is an accumulation of bad know-hows in the long history.
So we should not throw it away without understanding, I think.


>> - It is slightly disturbing to define a new class with Array inherited.
>> =A0 Is it really needed? =A0Is there no alternative approach?
> I agree and wish there was a good alternative. Unfortunately this is nece=
ssary because $LOADED_FEATURES is treated like an array by much existing co=
de (particularly tests), but we need it as a case-insensitive hash for the =
new algorithm. Perhaps the hash could be exposed directly as a class (like =
CaseInsensitiveHash), but this means more code, is potentially more complic=
ated, and means we are really changing the type of $LOADED_FEATURES. Though=
ts?

Aha, I understand why the inheritance is used.  It is to hook the
array modification, right?

It is an impossible approach because some extension library can
modify $LOADED_FEATURES directly by rb_ary_push.
I found amalgalite to do so actually:

http://www.google.com/codesearch/p?hl=3Dja#MyfZfO3_1cw/ext/amalgalite/amalg=
alite3_requires_bootstrap.c&q=3DLOADED_FEATURES%20lang:c%20rb_ary_push&l=3D=
151

> rb_ary_push( rb_gv_get( "$LOADED_FEATURES" ), require_name );

--=20
Yusuke Endoh <mame / tsg.ne.jp>