From: Trans Date: 2007-05-21T03:53:47+09:00 Subject: Re: Parser or Programmer? (was: Re: Why not adopt "Python Style" indentation for Ruby?) On May 20, 8:43 am, "Michael Fellinger" wrote: > On 5/20/07, Dick Davies wrote: > > > On 20/05/07, z...@cesmail.net wrote: > > > Quoting Robert Klemme : > > > > > Besides of that, personally I don't find the current Ruby syntax hard to > > > > read. Do you have some examples where you feel that reading Ruby is > > > > made hard(er) because of the liberties you mention? > > > > I can think of three examples right off the top of my head: Rails, Rake and > > > RSpec. There's something really eerie about seeing code like that. You *know* > > > it works, but you can't figure out why or how. > > > And you think replacing do/end with indentation would help? > > > I really can't see how - could you give an example? > > Let's try: > > describe 'myself' > it 'should be readable' > lambda > @reader.reading > .should change > @reader.knowledge > .by(text.amount) > > # pretty much impossible, if you ask me :) > # same in usual ruby now > > describe 'myself' do > it 'should be readable' > lambda{ @reader.reading }. > should change{ @reader.knowledge }. > by(text.amount) > end > end (I take it you meant 'if' not 'it') > # well? Actually, the later is pretty dang ugly --maybe worse the the first. However colons would help the first example quite a bit: describe 'myself': if 'should be readable': lambda: @reader.reading .should change: @reader.knowledge .by(text.amount) Though any such indention significance is probably too big of a change for Ruby at this point anyway. I'd much rather just see more intelligent was to catch missing "end" errors. Even if meant the option to put "endif", "endclass", etc. T. T.