From: Roger Pack Date: 2009-05-21T21:06:14+09:00 Subject: Re: Pythonic indentation (or: beating a dead horse) > Another concern I have about this idea, though, is having essentially > two forks of Ruby lexically speaking. It's not much of an obstacle, > but it is a minor difference that someone who comes along later to > maintain your code might find confusing or off-putting. And even > though this particular change might be relatively minor, where do we > draw the line? What makes us decide whether another optional syntax > change should be integrated into the language? Even many small > changes add up to a big difference in the way the code looks and the > ease of maintainability. Good point. There might be a way to go back and forth between the two, though,if that were any help. i.e. a = proc { 3+3 }. a.to_ruby_indented.to_ruby or what not (viz ruby2ruby). And the authors of gems using this syntax could require them transparently, i.e. some method like require_indented 'filename' or what not. > Macros, as I suggested above, would _really_ move in the direction of > potential Ruby code that looks radically different. But the payoff > would be enormous expressive power, the ability to mold the language > to suit the application domain in a very comprehensive way. The > removal of 'end', by contrast, would be only a slight improvement. It > would remove some visual noise and might attract a few Python > programmers. As I said, I think it's worth it if it's easy to > implement, but not if it's more difficult. Interesting--it's been awhile since I used C...what would macros...essentially do? An example of them? Tgarding the OP suggestion: I think it's an interesting idea. Start something for it on github and I'd be happy to help out. Here's some resources for it: http://ruby-toolbox.com/ "testing frameworks" The only real concern with it is that there is may be ambiguity if someone were to use the "a ? b : c" syntax (whatever it's called) and split that onto multiple lines just the "perfectly wrong way" a ? b : c Then that would break a naive pre processor. But not many people I know split those constructs across multiple lines, and they definitely wouldn't within a file they know to be using "ruby indented blocks" or whatever you want to call it. There's also the possible collision with 1.9's new symbol b: == :b but again, if you disallow that on end of line's then you're good to go. Best of luck. -=r -- Posted via http://www.ruby-forum.com/.