Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ruby and white-space delimitation?

0 views
Skip to first unread message

Iwan van der Kleyn

unread,
Mar 12, 2005, 12:52:15 AM3/12/05
to
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

George Ogata

unread,
Mar 12, 2005, 2:14:43 PM3/12/05
to
Iwan van der Kleyn <no...@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.

0 new messages