[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby and white-space delimitation?

Yuu

3/12/2005 5:52:00 AM

I'm using Ruby nowadays in favour of PHP like I switched from Java to
Python before. So considering these two "default" languages I can say
that I sorely miss Ruby's blocks in Python and conversely that I miss
white-space indentation in Ruby. Consider the following code

class Myclass
def initialize(arg)
if arg.significant
arg.each do | par |
#do something
end
end
end
end

All the "end"s are rather superflous and its a bore to fix them and
their indentation while refactoring. So my question is: couldn't the
"end" statement be made optional through some global switch or signal to
the parser?

Note that I wrote "optional" because using Python in HTML is a pain any
conversion of text often screws up Python code (because white-space gets
lost) In those cases using "end" is preferred,

Regards,

Iwan
1 Answer

George Ogata

3/12/2005 7:15:00 PM

0

Iwan van der Kleyn <none@none.net> writes:

> All the "end"s are rather superflous and its a bore to fix them and
> their indentation while refactoring. So my question is: couldn't the
> "end" statement be made optional through some global switch or signal
> to the parser?

I think this sort of thing has come up before. Certainly the whole
"significant indentation" issue's been rehashed again and again. It
seems most rubyists prefer the `end's.