
What is the formal difference in Scala between braces and parentheses? - LiveTheDream
http://stackoverflow.com/questions/4386127/what-is-the-formal-difference-in-scala-between-braces-and-parentheses-and-when-s
======
lrlucena
Parentheses are used to define tuples and to apply functions. For functions
with a single argument, parentheses are optional. In these cases you may need
to use braces to enclose some expression.

Example:

    
    
        1 to 10 filter (_%2==0)
    

The parentheses in this case are optional, but if you omit them you´ll have to
put expression _%2==0 inside a pair of braces:

    
    
        1 to 10 filter {_%2==0}

------
jamesaguilar
Scala:

    
    
        forever { features append randomFeature }
    

It's also OK to write this with parens. Maybe. I can't really tell.

------
keypusher
The more I learn about Scala, the less interested I become.

------
lucian1900
I can't believe Scala's syntax is so horribly complex. Also, just horrible.

