def test(name)
yield(name)
end
test("licheng"){|name| puts "hello #{name}"}
上面这段代码出现以下错误,不知为何?
-e:1:in `load': /Users/lic/RubymineProjects/test/test1.rb:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input (SyntaxError)
test("licheng"){|name| puts "hell...
... ^
from -e:1:in `<main>'