From: gabriele renzi Date: 2007-07-20T06:30:01+09:00 Subject: Re: RCR? Added syntax for chains that possibly return nil On Thu, 19 Jul 2007 22:31:01 +0900, Stefan Rusterholz wrote: > Do you think this RCR is worth to make? Sorry, I may have missed this in the previous thread, but why an inline rescue clause is not enough? i.e. while (line = gets && line.chomp) foo = (bar && bar.baz && bar.baz.quuz) || default # bar might be nil, so might bar.baz and bar.baz.quuz could be while line = gets.chomp rescue nil foo = bar.baz.quuz rescue default end I admit I have a strange feeling about a raising loop condition.. but something like the second line I wrote many times. This is slightly longer and gives you a little bit less control, but I think that complex one-line flow control may be a bad thing. Just my two cents, obviously. -- goto 10: http://www.goto10.it blog it: http://riffraff.blogsome.com blog en: http://www.riffraff.info