Make "fewerBraces" available outside snapshot releases

Yes, I’m pretty sure it’s been proposed, maybe even a couple of times.

But I think it’s ambiguous in the presence of new:

// Does this:
new Foo with Bar
// mean
object Tmp extends Foo, Bar; Tmp
// or
new Foo(Bar)
// ?

Even if the language moves away from new and with in extends clauses, it’ll still look surprising and ambiguous to programmers who were already used to the old syntax.

What I proposed at the time was to repurpose @ in expressions, since it’s currently only used in patterns. It’s such a handy symbol and it’s easy to remember it stands for @pplication…

   xs.map @ x => x + 1
     .foldLeft(4) @ (x, y) => x + y

    xs.groupMap 
      @ group = x => foo(x)
      @ map = x => x.toString

    obj.foo 
      @ a = bla, b = bla
      using cap1, cap2
3 Likes