【转】关于ruby中的yield
摘要:
def hello puts "Hello" yield yield puts "World" endhello {puts "MIDDLE"}执行结果:Process started >>> Hello MIDDLE MIDDLE World <<< Process finished最后一行如果改成 hello {}执行结果:Process started >>> Hello World <<< Process finished最后一行如果改成 helloPro 阅读全文
posted @ 2013-02-19 23:52 冰河程序猿 阅读(253) 评论(0) 推荐(0) 编辑