摘要: class Array def each_f() a=[] i=0 while i < self.size do a << (yield i) i += 1 end a end def map_f () each_f do |x| yield self[x] end end end a=[1,2,3,4] ... 阅读全文
posted @ 2009-04-18 18:00 麦飞 阅读(199) 评论(0) 推荐(0) 编辑