From: Joel VanderWerf Date: 2004-11-30T09:42:04+09:00 Subject: Re: Another improved error message request Sam Roberts wrote: > Quoteing matz@ruby-lang.org, on Tue, Nov 30, 2004 at 08:32:04AM +0900: ... >>The point is that >> >> 100.times | i | puts >> >>is totally valid syntax. It is very hard for a parser to detect this >>type of error. If anyone comes up with an idea, please tell me. > > > It is? Well, you would know... :-) but I'm confused! > > $ irb18 > irb(main):001:0> 100.times | i | puts > LocalJumpError: no block given > from (irb):1:in `times' > from (irb):1 This is a LocalJumpError only because times happens to need a block. irb(main):001:0> class Fixnum; def tmies; 4; end; end => nil irb(main):002:0> i = 5 => 5 irb(main):003:0> puts = 6 => 6 irb(main):004:0> 100.tmies | i | puts => 7