On 5/28/09, J Haas <Myrdred / gmail.com> wrote: > On May 28, 7:19 am, Caleb Clausen <vikk... / gmail.com> wrote: >> In my preprocessor, end is still allowed, it's just optional now. So >> you can copy and paste from a normal ruby file and not worry. (As log >> as the snippet you paste is properly indented.) > > This was my point. It would be good to still have the option of > freeform indentation. Much Ruby code _isn't_ presently canonically > formatted, and it'd break if put through your preprocessor. One If the end is misaligned, it will cause a warning on ruby 1.9. I think the language is already moving in the direction of encouraging you to properly indent everything anyway. We've had changes to ruby before which break old code before, and I think it's ok for this to be one too. (If this is going to be integrated into the core language at all.) Always maintaining backwards compatibility is one of the things that makes systems with a long history kludgy, and I'm glad ruby doesn't have that hangup. > solution to this would be to only activate the preprocessor on a per- > file basis, but I think a better solution would be for the > preprocessor not to damage existing code. The ultimate goal in the > long term should be to make this style part of core Ruby syntax rather > than the result of a preprocessor, and the best way to do that would > be for the parser to be able to distinguish between indentation-aware > blocks and "old-style" blocks. Let's look at an example: if foo: #new-style indentation block while bar #old-style ended block baz end Maybe you have something else in mind, idunno. To me, this just looks totally weird, and I wouldn't expect it to work at all. Parsing this (in a program) probably wouldn't be too much harder, but it's significantly jarring to human readers. (At least, to this one.)