From: Robert Klemme Date: 2007-03-24T01:05:06+09:00 Subject: Re: Question about if in Ruby On 23.03.2007 16:53, David A. Black wrote: > Hi -- > > On 3/23/07, John Joyce wrote: >> >> On Mar 23, 2007, at 9:59 PM, David A. Black wrote: >> > >> > Just for completeness (I'm not recommending it), I'll mention that >> > you can do: >> > >> > one_thing if begin >> > another_thing >> > a_third_thing >> > end >> > >> > >> > David >> >> Completeness is good. But that is pretty hideous stuff. >> Starting to look like some cryptic C or ambitious BASIC: >> logic spaghetti. > > I wouldn't worry too much: > > $ find . -name "*.rb" -exec grep "if begin" '{}' ';' | wc -l > 0 > > :-) Same here: 17:02:44 [~]: ruby -e 'puts Dir["/usr/lib/ruby/**/*.rb"].inject(0) {|c,f| /if\s+begin/ =~ File.read(f) ? c+1 : c}' 0 17:03:10 [~]: :-) robert