On 2005-03-21, Florian Gross <flgr / ccan.de> wrote:
> What about the multi-line form?
>
> x.do do
>    chop!
>    strip!
> end
>
> So I think that "do" is indeed a bad method name for this...

Yeah, that's somewhat bizarre... But not that bad. You could just stick
to the bracy version if you don't want to write funny code. Or
instance_eval and the do keyword if you feel that "do" is the
appropriate block delimiter somewhere.

If you have a code block of seven lines, your priority is not being
oversugared, rather being readable. If you just want to chain two method
calls, then the sugar comes handy. Thus there were no reason to abuse
the language in the above way.

> Perhaps we should just go with Kernel#with:
>
> with(x) do
>    chop!
>    strip!
> end
>
> But then the question is whether this should return the value of the 
> last statement or its argument...

You'd throw away object orientedness just to have fancy natural language
resemblence? I think that we may call #instance_eval by whatever name,
it should be a method of the given object.

Ok, then what about the following perverted idea: as now putting a
pair of parens after something which is not a method falls back to a
call to #call, why not make a fallback for 

x { block } 

as 

x.instance_eval { block }

?

Csaba