山本です。

ext/tk/sample 以下のサンプルプログラムを実行していて、
幾つか動かないものがありました。直し方がわかるものは
パッチもつけました。

//////////////////////////////////////////////////////////////////////////////////
// bindtag_sample.rb

bindtag_sample.rb:26: undefined method `bind' for nil:NilClass (NoMethodError)

* TkBindTag::ALL にインスタンスが設定されていない

Index: bindtag.rb
===================================================================
RCS file: /src/ruby/ext/tk/lib/tk/bindtag.rb,v
retrieving revision 1.3
diff -u -w -b -p -r1.3 bindtag.rb
--- bindtag.rb	16 Dec 2004 07:13:12 -0000	1.3
+++ bindtag.rb	15 Jan 2005 12:21:31 -0000
@@ -23,6 +23,7 @@ class TkBindTag
       @id = name
       BTagID_TBL[@id] = self
       bind(*args, &b) if args != []
+      self
     }
   end

//////////////////////////////////////////////////////////////////////////////////
// tkmenubutton.rb

e:/ruby/lib/ruby/1.8/tk.rb:1948:in `__invoke': unknown option "-parent" (Runtime
Error)
        from e:/ruby/lib/ruby/1.8/tk.rb:1948:in `_invoke'
        from e:/ruby/lib/ruby/1.8/tk.rb:1498:in `_ip_invoke_core'
        from e:/ruby/lib/ruby/1.8/tk.rb:1532:in `_tk_call_core'
        from e:/ruby/lib/ruby/1.8/tk.rb:1556:in `tk_call'
        from e:/ruby/lib/ruby/1.8/tk.rb:2635:in `configure'
        from e:/ruby/lib/ruby/1.8/tk/menu.rb:465:in `initialize'
        from tkmenubutton.rb:79:in `new'
        from tkmenubutton.rb:79
        from tkmenubutton.rb:76:in `new'
        from tkmenubutton.rb:76:in `new'
        from tkmenubutton.rb:76

* args == [] のとき、args[0] == nil にマッチしてしまうので間違った処理が
  行われる

Index: menu.rb
===================================================================
RCS file: /src/ruby/ext/tk/lib/tk/menu.rb,v
retrieving revision 1.1.2.11
diff -u -w -b -p -r1.1.2.11 menu.rb
--- menu.rb	8 Dec 2004 18:13:37 -0000	1.1.2.11
+++ menu.rb	14 Jan 2005 15:48:08 -0000
@@ -437,14 +437,14 @@ class TkOptionMenubutton<TkMenubutton
     keys = _symbolkey2str(keys)
 
     parent = nil
-    if args[0].kind_of?(TkWindow) || args[0] == nil
+    if !args.empty? && (args[0].kind_of?(TkWindow) || args[0] == nil)
       parent = args.shift 
     else
       parent = keys.delete('parent')
     end
 
     @variable = nil
-    if args[0].kind_of?(TkVariable) || args[0] == nil
+    if !args.empty? && (args[0].kind_of?(TkVariable) || args[0] == nil)
       @variable = args.shift 
     else
       @variable = keys.delete('variable')

//////////////////////////////////////////////////////////////////////////////////
// tkmsgcat-load_rb.rb

e:/ruby/lib/ruby/1.8/tk.rb:2137:in `new': tried to create Proc object without a
block (ArgumentError)
        from e:/ruby/lib/ruby/1.8/tk.rb:2137:in `bind'
        from tkmsgcat-load_rb.rb:50
        from tkmsgcat-load_rb.rb:49:in `new'
        from tkmsgcat-load_rb.rb:49:in `new'
        from tkmsgcat-load_rb.rb:49
        from tkmsgcat-load_rb.rb:48:in `each'
        from tkmsgcat-load_rb.rb:48
        from tkmsgcat-load_rb.rb:47:in `new'
        from tkmsgcat-load_rb.rb:47:in `new'
        from tkmsgcat-load_rb.rb:47
        from tkmsgcat-load_rb.rb:29:in `call'
        from tkmsgcat-load_rb.rb:99

//////////////////////////////////////////////////////////////////////////////////
// tkmsgcat-load_rb2.rb

e:/ruby/lib/ruby/1.8/tk.rb:2137:in `new': tried to create Proc object without a
block (ArgumentError)
        from e:/ruby/lib/ruby/1.8/tk.rb:2137:in `bind'
        from tkmsgcat-load_rb2.rb:50
        from tkmsgcat-load_rb2.rb:49:in `new'
        from tkmsgcat-load_rb2.rb:49:in `new'
        from tkmsgcat-load_rb2.rb:49
        from tkmsgcat-load_rb2.rb:48:in `each'
        from tkmsgcat-load_rb2.rb:48
        from tkmsgcat-load_rb2.rb:47:in `new'
        from tkmsgcat-load_rb2.rb:47:in `new'
        from tkmsgcat-load_rb2.rb:47
        from tkmsgcat-load_rb2.rb:29:in `call'
        from tkmsgcat-load_rb2.rb:99

//////////////////////////////////////////////////////////////////////////////////
// tkmsgcat-load_tk.rb

e:/ruby/lib/ruby/1.8/tk.rb:2137:in `new': tried to create Proc object without a
block (ArgumentError)
        from e:/ruby/lib/ruby/1.8/tk.rb:2137:in `bind'
        from tkmsgcat-load_tk.rb:48
        from tkmsgcat-load_tk.rb:47:in `new'
        from tkmsgcat-load_tk.rb:47:in `new'
        from tkmsgcat-load_tk.rb:47
        from tkmsgcat-load_tk.rb:46:in `each'
        from tkmsgcat-load_tk.rb:46
        from tkmsgcat-load_tk.rb:45:in `new'
        from tkmsgcat-load_tk.rb:45:in `new'
        from tkmsgcat-load_tk.rb:45
        from tkmsgcat-load_tk.rb:28:in `call'
        from tkmsgcat-load_tk.rb:115

* サンプルプログラムに ???_proc という名前の変数があるが、その型が String に
  なっていた(修正の仕方は不明)

//////////////////////////////////////////////////////////////////////////////////
// tkextlib/iwidgets/sample/mainwindow.rb

e:/ruby/lib/ruby/1.8/tk.rb:1383: [BUG] Segmentation fault
ruby 1.8.2 (2005-01-12) [i386-bccwin32]


Abnormal program termination

* 2つウィンドウが表示され、main window と書かれた何もないウィンドウを閉じると
  問題なく、色々表示されているウィンドウを閉じようとすると確認ダイアログが表示され、
  yes とすると落ちる。

アプリケーション例外が発生しました:
        アプリケーション:  (pid=1128)
        発生時間:  2005/01/15 @ 19:34:18.658
        例外番号:  c0000005 (アクセス違反)

ファンクション: TkEventDeadWindow
        1005884e 8b4dfc           mov     ecx,[ebp+0xfc]         ss:030699a6=????????
        10058851 8b5104           mov     edx,[ecx+0x4]          ds:00c5aee8=????????
        10058854 8955f4           mov     [ebp+0xf4],edx         ss:030699a6=????????
        10058857 eb09             jmp     Tk_MaintainGeometry+0x13e (10061362)
        10058859 8b45f4           mov     eax,[ebp+0xf4]         ss:030699a6=????????
        1005885c 8b480c           mov     ecx,[eax+0xc]          ds:03b99ee6=????????
        1005885f 894df4           mov     [ebp+0xf4],ecx         ss:030699a6=????????
        10058862 837df400         cmp   dword ptr [ebp+0xf4],0x0 ss:030699a6=????????
        10058866 742c             jz      Tk_MaintainGeometry+0x170 (10061394)
        10058868 8b55f4           mov     edx,[ebp+0xf4]         ss:030699a6=????????
フォールト ->1005886b 8b4208           mov     eax,[edx+0x8]          ds:00c5aee8=????????
        1005886e 3b45f8           cmp     eax,[ebp+0xf8]         ss:030699a6=????????
        10058871 750a             jnz     Tk_MaintainGeometry+0x159 (1006137d)
        10058873 8b4df4           mov     ecx,[ebp+0xf4]         ss:030699a6=????????
        10058876 c7410800000000   mov    dword ptr [ecx+0x8],0x0 ds:00c5aee8=????????
        1005887d 8b55f4           mov     edx,[ebp+0xf4]         ss:030699a6=????????
        10058880 8b4204           mov     eax,[edx+0x4]          ds:00c5aee8=????????
        10058883 3b4508           cmp     eax,[ebp+0x8]          ss:030699a6=????????
        10058886 750a             jnz     Tk_MaintainGeometry+0x16e (10061392)
        10058888 8b4df4           mov     ecx,[ebp+0xf4]         ss:030699a6=????????
        1005888b c7410400000000   mov    dword ptr [ecx+0x4],0x0 ds:00c5aee8=????????
        10058892 ebc5             jmp     Tk_MaintainGeometry+0x235 (10061459)

*----> スタック バック トレース <----*

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4 ファンクション名
0240FAC0 100B5048 092DD3B0 030819A0 0240FB10 77F81F55 !TkEventDeadWindow 
0240FB50 100B4E13 092DD3B0 030819A0 0240FBA0 092DD3B0 !Tk_DestroyWindow 
0240FBE0 100B4E13 03105A00 030819A0 0240FC30 03105A00 !Tk_DestroyWindow 
0240FC70 100B4E13 0924AFE0 030819A0 0240FCC0 0924AFE0 !Tk_DestroyWindow 
0240FD00 100B4E13 09273F10 77F82528 FFFFFFFF 09273F10 !Tk_DestroyWindow 
0240FD90 100B4E13 091CA0F8 00038007 0240FDE0 091CA0F8 !Tk_DestroyWindow 
0240FE20 100B4E13 091C7CE0 00000001 00000000 091C7CE0 !Tk_DestroyWindow 
0240FEB0 02F85465 0308A5C0 0308A5C0 0240FEF0 02F85A8B !Tk_DestroyWindow 
0240FEC0 02F85A8B 02F46318 00000001 03018DE6 030AB1F8 !<nosymbols> 
0240FEF0 0253ADED 02C8FC8C 00000001 02C53840 02BFE490 !<nosymbols> 
0240FF08 02521BAD 02521CA4 0240FF68 7FFDF000 00000000 !rb_gc_call_finalizer_at_exit 
0240FF68 02521DC3 00000000 0240FF84 02521E0C 00000006 !ruby_options 
0240FF74 02521E0C 00000006 00000006 0240FF8C 00401280 !ruby_stop 
0240FF84 00401280 0240FFB8 3256E7B6 00000002 02B4550C !ruby_run 
0240FF8C 3256E7B6 00000002 02B4550C 02B42BB0 00000000 !_GetExceptDLLinfo 
0240FFB8 00000000 0040204C 77E7893D 00000000 02BA3780 !_startup 


//////////////////////////////////////////////////////////////////////////////////
// tkextlib/tkHTML/ss.rb

NameError: undefined local variable or method `load_file' for main:Object
---< backtrace of Ruby side >-----
tkextlib/tkHTML/ss.rb:170
tkextlib/tkHTML/ss.rb:162:in `call'
e:/ruby/lib/ruby/1.8/tk.rb:1089:in `eval_cmd'
e:/ruby/lib/ruby/1.8/tk.rb:1089:in `cb_eval'
e:/ruby/lib/ruby/1.8/tk.rb:1040:in `call'
e:/ruby/lib/ruby/1.8/tk.rb:1178:in `callback'
e:/ruby/lib/ruby/1.8/tk.rb:1383:in `mainloop'
e:/ruby/lib/ruby/1.8/tk.rb:1383:in `mainloop'
tkextlib/tkHTML/ss.rb:404
---< backtrace of Tk side >-------
    invoked from within
"rb_out c00005"
    (menu invoke)

* 下のコードと同じ理由で未定義エラーになる。procの仕様?

#proc2 = nil #このコメントを外すと動く

proc1 = proc { proc2.call }
proc2 = proc { puts "abc" }

proc1.call