From: Akinori MUSHA Date: 2007-03-03T18:44:30+09:00 Subject: [ruby-dev:30470] Re: fail to autoload at $SAFE==4 --pgp-sign-Multipart_Sat_Mar__3_18:44:29_2007-1 Content-Type: text/plain; charset=ISO-2022-JP At Sat, 3 Mar 2007 15:32:09 +0900, I wrote: > At Thu, 1 Mar 2007 00:57:53 +0900, > Hidetoshi NAGAI wrote: > > From: "Nobuyoshi Nakada" > > Subject: [ruby-dev:30437] Re: fail to autoload at $SAFE==4 > > Date: Tue, 27 Feb 2007 15:02:33 +0900 > > Message-ID: > > > 今気づきましたが、動的にスクリプトを$LOAD_PATHに作るという可能性 > > > を考えるなら、ロード済みの.soの有無をロード中の.rbの有無よりも優 > > > 先させてはまずいので、最後のif文はこうですね。 > > > > > > if (rb_feature_p(feature, feature + strlen(feature), Qtrue)) > > > > すみません.きちんとチェックしていませんでした. > > この if 文の形で commit されてしまいましたが, > > これだと更にまずいみたいで, > > ----------------------------------------------------------------------- > > ruby -r tk -e 'TkButton.new' > > /usr/local/lib/ruby/1.8/tk/label.rb:6: uninitialized constant TkLabel > > (NameError) > > from /usr/local/lib/ruby/1.8/tk/button.rb:5:in `require' > > from /usr/local/lib/ruby/1.8/tk/button.rb:5 > > from -e:1 > > ----------------------------------------------------------------------- > > なんてことになってしまいます. > > > > TkButton に対する autoload で tk/button.rb を load した際に > > "require 'tk/label'" が実行され,tk/label.rb の上の > > "class TkLabel > > > 上記の if 文の部分が "if (rb_feature_p(feature, 0, Qfalse) == 'r')" > > であれば,このようにはなりません. > >  この件はどうしましょうか。  その後の中田さんのコミットで修正されたようです。 ruby_1_8_6 にも入れました。 -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Different eyes see different things, Different hearts beat on different strings -- But there are times for you and me when all such things agree" --pgp-sign-Multipart_Sat_Mar__3_18:44:29_2007-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQBF6UN9kgvvx5/Z4e4RAgJ/AJ43CyrAUYSBiIc+WsXwIaLCKXbgNwCgnSrl dyPvkcMAmr37jFg3ewoA12U= =V/Hx -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sat_Mar__3_18:44:29_2007-1--