Hi --

On Wed, 10 Sep 2008, Kornelius Kalnbach wrote:

> hello!
>
> Ruby allows code like this:
>
>  def file_replace filename, file,
>    files = document.files
>
> In this case, it was a typo, and could have produced problems. I'm not
> sure how many people are using multi-line method declarations
> intentionally, but I think they are few.
>
> So I suggest that the Ruby parser issues a warning, like:
>
>  warning: trailing comma in method declaration
>
> It should be possible to silence the warning:
>
>  def file_replace filename, file, \
>    files = document.files
>
> with the backslash making clear what you want here.
>
> What do you think?

I believe the comma already makes it clear what you want. I would not
like to get a warning and have to put in a slash. I'd rather just live
with the general rule. I think that in every imaginable case, if you
didn't mean to put the comma, you'd find out very quickly and could
fix it.


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   Intro to Ruby on Rails  January 12-15   Fort Lauderdale, FL
   Advancing with Rails    January 19-22   Fort Lauderdale, FL *
   * Co-taught with Patrick Ewing!
See http://www.rubypal.com for details and updates!