From: ts Date: 2004-04-20T00:01:44+09:00 Subject: Re: convert yield to proc >>>>> "Z" == Zsban Ambrus writes: Z> def mypr; if block_given?; then proc do yield; end; else proc do puts Z> "default"; end; end; end; p= mypr do puts "hi"; end; 5.times(&p); q= mypr; Z> 5.times(&q); Well, try this def mypr; if block_given?; then proc do yield; end; else proc do puts "default"; break; end; end; end; p= mypr do puts "hi"; break; end; 5.times(&p); q= mypr; 5.times(&q); This is not me which have tried to obfuscate the code :-))) Guy Decoux