On 5/28/09, James Britt <james.britt / gmail.com> wrote:
> Caleb Clausen wrote:
>> Can you give an example?
>
> def foo big,
>          list,
>          of,
>          args
>
>    some.stuff
>    some.stuff
>    some.stuff
>
>
>           something.more.important!
>           look.at.me!
>
>
>    more.stuff = boring
>
>
> end

This (and your other, similar example) actually works in endless.rb
right now. Leave off the end and it inserts one for you, just where
you'd expect. You can always indent things more than necessary, and
that's fine. If you'd wanted to indent less than the surrounding code,
then I'd be in trouble. This won't work:

def foo big,
         list,
         of,
         args

   some.stuff
   some.stuff
   some.stuff


something.more.important!
look.at.me!


   more.stuff = boring


Gregory Brown wrote:
> def foo("bar", :a => 1, :b => 2,
>                     :c => 3, :d => 4)
>
>
> end

But that's not legal. Presumably you meant either this:

def foo(bar, a = 1, b = 2,
                     c = 3, d = 4)


end

or this:

foo("bar", :a => 1, :b => 2,
                     :c => 3, :d => 4) do


end

Both break endless.rb. I sort of expected that the second one would
fail as soon as I saw it (do is the only thing that requires an end
but doesn't begin the expressions which it belongs to; I neglected to
consider the case of a do on a line after the one where it's method
call begins). But the first is a surprise.... that should have worked.
Well, they both should work, but now I have 2 bugs to fix. Thanks for
the test cases!