Robert Dober
6/3/2009 6:18:00 PM
I am not sure what you want to do?
Do you want to return, than I think the above might work with some
tweaking for the non break case, sorry I was lazy.
Or do you just want to break, but than it will not work in Ruby1.9?
Please avoid "for" it confuses me, please use each for my poor brain ;).
Anyway what about this
catch( x ) do
values.each do
throw your_value if some_condition
end
some more code
end
Nahh, I guess if you refactor this into methods it will just be
simpler ;) or use Joel's #find if you can, that might give some clean
code too :)
Cheers
Robert
--=20
Toutes les grandes personnes ont d=92abord =E9t=E9 des enfants, mais peu
d=92entre elles s=92en souviennent.
All adults have been children first, but not many remember.
[Antoine de Saint-Exup=E9ry]