From: Joel VanderWerf Date: 2007-05-23T02:08:33+09:00 Subject: Re: How to adopt "Python Style" indentation for Ruby Rick DeNatale wrote: > On 5/22/07, M. Edward (Ed) Borasky wrote: ... >> 2. Both curly braces and begin / end pairs to define scope, with one >> variant having a higher binding priority than the other. The fact that I >> don't even remember which one it is that has the higher binding priority >> is an added factor in my dislike. > > I think there's some misunderstanding here. > > Curly braces are used to denote a proc, begin/end delimits a sequence > of expressions which are executed in sequence and whose value is the > last expression executed. Ed probably meant do...end, not begin...end. > {} and do/end aren't operators, but in almost all cases delimit procs > and so the question of their relative priority is moot as far as I can > tell since you can't have two procs next to each other in ruby source. This is the precedence issue: def foo(*) puts "FOO" if block_given? end def bar(*) puts "BAR" if block_given? end foo bar do end foo bar { } __END__ Output: FOO BAR -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407