Ruby Catch Throw Test
catch :label do
(1..10).each do |i|
(11..13).each do |j|
puts 'i=' + i.to_s + ', j=' + j.to_s
throw :label if i == 3 and j == 12
end
end
end
puts 'over'
catch :label do
(1..10).each do |i|
(11..13).each do |j|
puts 'i=' + i.to_s + ', j=' + j.to_s
throw :label if i == 3 and j == 12
end
end
end
puts 'over'
发表者 俞 伟军 位置在: 6/28/2007 10:24:00 PM
No comments :
Post a Comment