summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-26 08:22:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-26 08:22:33 +0000
commitb4fd4d6018a8ad72f69912606c60ec42ee3b62b8 (patch)
tree7d8e6794c8b14219eb3a1902d6538ea27a239065 /ext
parentea325deab0729bf17d3f366aa6369d93a4db54fd (diff)
* eval.c (Init_Proc): Block/Proc separation. [huge change]
* eval.c (block_arity): returns exact arity number for Procs out of methods. also gives 1 for {|a|..}. * string.c (rb_str_match): revert use of String#index for invocation like string =~ string. * eval.c (rb_Array): move Object#to_a exclusion hack from splat_value(). need to be in eval.c for a while. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/tk.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 9a156eed02..b908aaa240 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -80,7 +80,13 @@ module TkComm
while idx and idx > 0 and str[idx-1] == ?\\
idx = str.index('{', idx+1)
end
- return tk_tcl2ruby(str) unless idx
+ unless idx
+ list = tk_tcl2ruby(str)
+ unless Array === list
+ list = [list]
+ end
+ return list
+ end
list = tk_tcl2ruby(str[0,idx])
list = [] if list == ""
@@ -93,6 +99,9 @@ module TkComm
brace -= 1 if c == ?}
break if brace == 0
}
+ if str.size == i + 1
+ return tk_split_list(str[0, i])
+ end
if str[0, i] == ' '
list.push ' '
else
@@ -193,7 +202,7 @@ module TkComm
end
end
def list(val)
- tk_split_list(val).to_a
+ tk_split_list(val)
end
def window(val)
Tk_WINDOWS[val]
@@ -573,7 +582,7 @@ module TkCore
end
def TkCore.callback(arg)
- arg = Array(tk_split_list(arg))
+ arg = tk_split_list(arg)
_get_eval_string(TkUtil.eval_cmd(Tk_CMDTBL[arg.shift], *arg))
end