From: Mike Gold Date: 2009-01-16T08:20:41+09:00 Subject: Re: functional programming Pascal J. Bourguignon wrote: > Ok, here is how you could implement an object with Ruby closures: define_method lets you implement objects using locals bound to a closure, object = Class.new { data = 0 define_method(:data) { data += 1 } }.new p object.data #=> 1 p object.data #=> 2 -- Posted via http://www.ruby-forum.com/.