News for hackers. Stuff that matters.
Re:Ruby Tips Part 2 by losvedir on Monday September 16, 2013 @09:28AM (#6393101)
Great article. One question:

> There’s one final use for the splat ( * ); when overriding methods in a subclass and calling super. If it turns out you don’t need the arguments to the method for whatever additional behaviour you’re adding, you can accept all arguments with a bare splat, then a bare super passes all arguments to super.

I thought that was the default behavior of super. Isn't it the case that a bare super by default passes all the method's original arguments? I know this has bit me in the past where I've been forced to call `super()` with empty parentheses explicitly to prevent this behavior.

Re:Ruby Tips Part 2 by matsadler on Monday September 16, 2013 @09:36AM (#6393141)
You're correct, that is the default behaviour of super.

My intention wasn't to say that super only works like that when you've defined the method like `def foo( * )` but rather `def foo( * )` is an alternative to having to name your arguments when you're not even going to use them as they are automatically passed with bare super.

Re:Ruby Tips Part 2 by losvedir on Monday September 16, 2013 @10:36AM (#6393455)
Ah, yes, of course. I understand now. Skimmed a bit too fast there and misunderstood what you were getting at. Thanks!