>>>>> "K" == KONTRA Gergely <kgergely / mlabdial.hit.bme.hu> writes:

>> Use a closure
K> Could you be more verbose? Eg. how to print out how many times a

 in ruby, yes. in english, no :-)

K> function was called.

svg% cat b.rb
#!/usr/bin/ruby
def test1
   a = 10
   proc { a += 1; puts a }
end

class Object
   define_method(:tt, test1)
end

tt
tt

uu = test1
uu[]
uu[]
svg% 

svg% b.rb
11
12
11
12
svg% 



Guy Decoux