摘要: Block Block 不是对象,是Ruby的语言特性,近似于闭包(Closure)。 范例: def meth res= yield "Block called returns #{res}"endputs meth do next “next_value” end #Block called returns next_value puts meth do brea... 阅读全文
posted @ 2009-11-25 16:13 napoleon_liu 阅读(824) 评论(0) 推荐(2) 编辑