From: "Joe Wölfel" Date: 2008-10-08T03:10:16+09:00 Subject: Re: Why not adopt "Python Style" indentation for Ruby? It seems that DSLs in Ruby get some of their power from the optional nature of parenthesis. I wonder if making 'end' more optional too would make DSLs yet more powerful and expressive. It might be an interesting experiment to see what Ruby would look like if 'end' were optional in places where indentation made it unambiguous. In that way, it would be consistent with parenthesis being optional. BTW, the term "domain-specific language" seems inaccurate. Many of these languages are really double-entendre languages. Their power of expression seems to come from having two equally good and correct interpretations - one domain specific and one in Ruby. The double entendre doesn't just eliminate clutter, it also eliminates the mental gymnastics required to translate from one language to another. On 6 oct. 08, at 13:35, Frasier Mruby wrote: > Dear Mats, > > I am kind of new to ruby and like it after looking python first. As > some other people said, my only major complaint is it's many "END". > Among java/c/C++/python, the "END" keep reminding me the inconvenience > of it during coding ruby. I like ruby because it's easy to learn, and > to read. It's designed for be friends of programmers. But I feel the > "END" may have a negative role to ruby's purpose or attraction. > > I am fine to have "END" for class or methods. But for IF,WHILE, CASE, > FOR, etc., when there are many levels it often make me confused > what the > matching part of the those "END"s are. > > I understand and agree your comment that ruby had better to have > something to close the code block. But I sincerely hope you could come > up something else to replace the "END". > > My first thought to use brace "{...}" to replace "END" since it's a > popular convention. > > I suggest to use only the "do...end" to formalize the blocks, brace {} > will be stopped to be used. It seems to me it's a waste of symbols to > have two ways to represent blocks, which may not be the most > frequently > used. Or consider to use use: > "/* */", "|...|", "<...>", "[...]" , "(...)", "((...))", , > "//...//", " > :...: ", " '...' ", " `...` " for blocks. > > To enhance readability is probably one of ruby's design purpose and I > really hope some thing could be done earlier to make the "END" looks > prettier. > > Thank you! > > On 18/05/07, Yukihiro Matsumoto wrote: >> * tab/space mixture >> * templates, e.g. eRuby >> * expression with code chunk, e.g lambdas and blocks > * clipboards, email, pastebins, and other places where the code is > not > preserved literally > > -- > Posted via http://www.ruby-forum.com/. >