在Ruby 1.9.1中,如果你这样做
$VERBOSE = true
puts /m/ , 42.to_s
Run Code Online (Sandbox Code Playgroud)
或者如果我这样做
$VERBOSE = true
puts /m/ , "42"
Run Code Online (Sandbox Code Playgroud)
你收到了警告
warning: ambiguous first argument; put parentheses or even spaces
Run Code Online (Sandbox Code Playgroud)
但是,如果我这样做,我就不会理解
$VERBOSE = true
puts "m" , 42.to_s
Run Code Online (Sandbox Code Playgroud)
要么
$VERBOSE = true
puts(/m/, 42.to_s)
Run Code Online (Sandbox Code Playgroud)
那么什么具体触发了这个警告?还有什么空间可以添加到原始表达式中?