2010/7/11 Caleb Clausen <vikkous / gmail.com>:
> On 7/11/10, Robert Klemme <shortcutter / googlemail.com> wrote:
>> On 11.07.2010 13:32, Caleb Clausen wrote:
>>> On 7/11/10, Robert Klemme<shortcutter / googlemail.com>  >>>> IMHO this is not feasible: "if<condition>" is almost always followed by
>>>> a line break.   >>>
>>> Yes, but 'if' itself almost never is.
>>
>> Unfortunately the word "almost" makes this unusable for creating a
>> parser.             >> of the rare cases?         
>> awful hack and I'd rather not make parsing more complicated (and thus
>> slower) as it is today.
>
> The syntax change I proposed requires forbidding a construct which is
> currently legal but rarely used and considered to be poor style. What
> is wrong with that? In those few cases where someone decided to
> separate an 'if' from its condition with a newline, the code would
> have to be rewritten (inserting a backslash to make the newline soft
> is the easiest way). Such constructs should be rewritten anyway, for
> purely stylistic reasons.

I mostly agree apart from the missing aspect of efforts.  Even such a
small change can cause significant other work to be done.

> This new feature, like most,      
> slower. The delta is tiny and not worth mentioning.
>
> And it will make the parser a little bit more complicated; however,
> there are already many special cases and complications in the parser.
> One more is not a big deal. The philosophy of ruby's syntax overall is
> to make the parser complicated if it makes life easier for the user. I
> think this change at least ought to be considered under that
> criterion.
>
> Now if you want to argue that Jan's proposal is esthetically
> unpleasing, I won't really disagree. But just leave it at that. I hate
> it when people try to throw up a lot of rhetorical chaff when their
> real, and only valid, objection amounts to a subjective judgment call.

It's not only that.  I question the balance of effort and benefit.
Since most code around does not use the new syntax, you will have to
support the old syntax as well.  As long as it is not mandatory only
people benefit that use it.  OTOH, there is additional effort for
backporting new code to projects that only use an old Ruby
interpreter.  Given that we do not have this feature today and most
people seem to be able to write code that gets the nesting right I
wonder what the real benefit of this is given that there will be
development effort for the interpreter, test cases, documentation etc.

Uglyness was really just a side aspect although I agree I should have
made this more clear.  Somehow I must have assumed that the other
points are obvious. :-)

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/