Ruby and white-space delimitation?

I

Iwan van der Kleyn

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
 
G

George Ogata

Iwan van der Kleyn said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top