From: "Iñaki Baz Castillo" Date: 2011-08-22T17:43:47+09:00 Subject: Re: Possble bug in Ruby parser (Fixnum#times within "case" statement) 2011/8/22 Ryan Davis : > I still say it contributes nothing and only serves to obfuscate your code. You can always pull it out to something MUCH more readable: > >    kk until valid? Yes, "kk" method is useless, already said that in my previous example. My real code looks more like the following: ------------------ def receive_data(data) @buffer << data while (case @state when :init @parser.reset @parser_nbytes = 0 @state = :headers when :headers parse_headers when :body get_body when :finished process_request @state = :init # return true to continue processing possible TCP remaining data. true when :ignore false end) do end # while end ------------------ -- Iñaki Baz Castillo