4 ms·
I look at those commas and wonder why? Is there a reason other than "must keep separators from normal function call"?
by protomyth 13y ago
I look at those commas and wonder why? Is there a reason other than "must keep separators from normal function call"?
- taternuts 13y agoit kind of helps me visually dissect the parameters better - I'm sure if I got used to omitted commas it wouldn't be that big of a deal. When I would run into ruby code that omitted the parenthesis on a function call, it was considerably tougher to read for me.
- noblethrasher 13y agoLabeled parameters are optional. In fact they're so optional, that you don't even have to label all of the parameters at a call site (just the ones that appear after the first labeled parameter). So with that (mis)feature, eliding commas would make a lot of code harder to reader.
- masklinn 13y ago> So with that (mis)feature, eliding commas would make a lot of code harder to reader. Not really. Lisps get by without them and it doesn't have formal keyword parameters.
- noblethrasher 13y agoTrue, but that's an advantage of Lisp's uniformity. Imagine passing a query comprehension (or two) as arguments. Foo(from n in range select n * n into: from n in range where n % 2 == 0 select n)