[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: reuse passed proc later?

Peña, Botp

10/30/2004 10:26:00 AM

David Gurba [mailto:blue_technx@lycos.com] wrote:

//I want to do the following (with as little modfication as necessary):
//
//call a passed block to a function at some later time... Eg.
//

c:\family\ruby>ruby -w a1.rb
hello
world,
ruby

c:\family\ruby>cat a1.rb
class C
attr_accessor :m
end


a = C.new

a.m = proc { puts "hello"}
a.m.call
a.m = proc { puts "world, "}
a.m.call
a.m = proc { puts "ruby"}
a.m.call


//
//David G.
//--

kind regards -botp