2.7 节中有一个例子
def who_says_what
yield ( "Dave" , "hello" )
yield ( "Andy", "goodbye" )
end
who_says_what {|person, phrase| puts "#{person} says #{phrase}"}
Dave says hello
syntax error, unexpected ',', expecting ')' yield ( "Dave" , "hello" ) ^ syntax error, unexpected ')', expecting keyword_end syntax error, unexpected ',', expecting ')' yield ( "Andy", "goodbye" ) ^ syntax error, unexpected ')', expecting keyword_end syntax error, unexpected tIDENTIFIER, expecting '}' ...on} says #{phrase}"}
看文档也没发现哪里用错了,谁能帮我看看?