From: "Peña, Botp" Date: 2007-11-07T18:26:41+09:00 Subject: Re: Sort and a multiline block From: Phrogz [mailto:phrogz@mac.com] # This line: # p foo { ... } # is interpreted as # p( foo{ ... } ) # # While this line: # p foo do ... end # is interpreted as # p(foo) do ... end # # The lower precedence of do/end is causing it to be bound to the result # of p( foo ), or in your case p( array.sort ) indeed, but the sad part really is ruby does not check blocks, like as if they float silently like shadows :( eg > p{|x| p x} => nil > puts{|x| p x} => nil > "sdf".upcase{|x| p x} => "SDF" > def m > end => nil > m{|x| p x} => nil i would consider those as bugs though :( i just wish blocks were like clear and visible proc params. kind regards -botp