From: Michael Fellinger Date: 2007-05-20T21:38:29+09:00 Subject: Re: Why not adopt "Python Style" indentation for Ruby? On 5/20/07, Peter Marsh wrote: > Trans wrote: > > On May 18, 5:22 pm, Sven Suska wrote: > >> but would provide a way to use significant indentation if one really > >> wants to. > >> > >> If "~" were that special character, it would look like that: > >> ~ 5.times do |n| > >> ~ n.times do > >> ~ print n > >> ~ puts > > > > I can't count how many times I've forgotten "do". Sometimes I have > > wished a colon could "induce" the block: > > > > 5.times |n|: > > n.times: > > print n > > puts > > > > But I don't think a line prefix is worth the trouble. > > > > T. > > I totally agree. A line pre-fix is a bit pointless in my opinion, > although I am in favour in moving towards a Python-style indentation > syntax. As for the 'do' issue I don't see why it can't be removed, if > something is always expected then you can just assume its there, right? > > 5.times do |n| > n.times do > print n > end > puts > end > > (Or using the ':' instead) Could just be: > > 5.times |n| > n.times > print n > end > puts > end > Sorry, but how would you handle block_given? without parameters? > -- > Posted via http://www.ruby-forum.com/. > >