From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2003-04-27T10:51:29+09:00 Subject: Re: Ruby misfeature? => CONTEST: solve the following problem In article <20030426221505.GA7411@student.ei.uni-stuttgart.de>, Mauricio Fern�ndez wrote: > >What's the output of the following script? >Points awarded only if you don't run it ;) > > >#raise "Gave up already?" > >def with(*objs, &block) > objs.each { |o| o.instance_eval(&block) } >end > >a = % > > >b = % > > >c = % > > >d = % > > >with a,b,c,d do > case self > when " "; puts "foo" > when "\t"; puts "bar" > when "\n"; puts "baz" > end >end > > >This feature has some serious potential for abuse! Good enough for an >almost indecipherable obfuscated Ruby program... > >We shall now see who's got the best MUA :-) OK, I'll admit to cheating by running this script... I didn't see it print anything. Phil