This all would not happen, of course, if expressions were parsed always up to the next divider (semicolon, brace, parenthesis or whatever C++ or Java do).
h + if + g +val sum = a + b + c +d + e +
resolves the issue, no?
The issue is resolved by using parentheses, and everything else is paint on an imaginary bikeshed.
As long as people are smart enough never to miss that, either
> val sum = a + b + cIs it so onerous to type
> + d + e
> + f + g
> + h + i
val sum = (a + b + c
+ d + e+ h + i)
+ f + g
? And I can't tell, but are you proposing the end of semicolon inference in order to correct this?
Or you could use indentation to indicate a continuation line :-POn 4 September 2013 15:32, Oliver Ruebenacker <cur...@gmail.com> wrote:
This all would not happen, of course, if expressions were parsed always up to the next divider (semicolon, brace, parenthesis or whatever C++ or Java do).
> The preferred style for such expressionsPreferred by who? I prefer (partly for this reason) to use a trailing operator...
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Right, but you are proposing we enforce semicolons. Given that idiomatic Scala typically has 0 semicolons, suddenly asking everyone to add semicolons after several years seems significantly more onerous than having a coding standard for parens around multiline expressions with infix operators.
Or you could use indentation to indicate a continuation line :-PHow would that work?
It's quite ironic that Scala goes great lengths to allow DSLs, but you can't write math expressions according to international standards.
Hello,On Wed, Sep 4, 2013 at 10:40 AM, Ryan Hendrickson <Ryan.Hen...@bwater.com> wrote:
> val sum = a + b + cIs it so onerous to type
> + d + e
> + f + g
> + h + i
val sum = (a + b + c
+ d + e+ h + i)
+ f + g
And then add a comment to other developers that these parentheses actually serve a purpose, so that no one goes and deletes them? Yes, that would be onerous.
? And I can't tell, but are you proposing the end of semicolon inference in order to correct this?Yes, I am proposing semicolons. Posing it as "semicolon interference", you are implying that the semicolons provide no additional information. The truth is, they do, as the example shows.
On Wednesday, September 4, 2013 8:16:42 AM UTC-7, Oliver Ruebenacker wrote:Hello,On Wed, Sep 4, 2013 at 10:40 AM, Ryan Hendrickson <Ryan.Hen...@bwater.com> wrote:
> val sum = a + b + cIs it so onerous to type
> + d + e
> + f + g
> + h + i
val sum = (a + b + c
+ d + e+ h + i)
+ f + g
And then add a comment to other developers that these parentheses actually serve a purpose, so that no one goes and deletes them? Yes, that would be onerous.
If you normally have people editing your code base who are unfamiliar with the rules of the language it is written in, you're going to need a lot of such comments. But sensible shops don't do that, and don't need them.
? And I can't tell, but are you proposing the end of semicolon inference in order to correct this?Yes, I am proposing semicolons. Posing it as "semicolon interference", you are implying that the semicolons provide no additional information. The truth is, they do, as the example shows.
It's "inference", not "interference", and it's not being "posed", it's an existing feature of the Scala language, one that is heavily used and widely liked. To even suggest eliminating it amounts to trolling.
Best,Oliver
--Be always grateful, but never satisfied.
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.