From: Ryan Davis Date: 2010-07-10T04:17:57+09:00 Subject: Re: what about allowing to specify, which end belongs to which start? On Jul 9, 2010, at 12:05 , Jan Lelis wrote: > I've recently come across a pretty common situation in Ruby: > > end > end > end > > After those parts, you often don't know, where exactly you have to > continue. > > So what about allowing to specify, which end belongs to which start? > I've thought about something like this: > > end|do > end|if > end|def > > or > > end~do > end~if > end~def > > or > > end:do > end:if > end:def > > If you specify it, and it does not match, the compiler throws an error. > Of course, you can always omit it to have the normal behaviour, but you > are encouraged to often "document", which end belongs to which block > (and you do yourself a favour in these nested situations). > > What do you think about it? I think if you have so many ends that you need to extend the syntax then you're doing something wrong to begin with (no pun). I try to make all my methods short when I can, and I use judicious use of extra returns to separate code into paragraphs to further help. I think this type of syntax extension would further encourage large bad codes.